Reduce the area generated for cmd::CopyRegion when we move a selection

This commit is contained in:
David Capello 2015-06-25 17:36:14 -03:00
parent 4aa56ff703
commit 3159acdc5c

View File

@ -453,8 +453,14 @@ void PixelsMovement::stampImage()
TiledMode::NONE, m_transaction, TiledMode::NONE, m_transaction,
ExpandCelCanvas::None); ExpandCelCanvas::None);
// TODO can we reduce this region? // We cannot use cel->bounds() because cel->image() is nullptr
gfx::Region modifiedRegion(expand.getDestCanvas()->bounds()); gfx::Rect modifiedRect(
cel->x(),
cel->y(),
image->width(),
image->height());
gfx::Region modifiedRegion(modifiedRect);
expand.validateDestCanvas(modifiedRegion); expand.validateDestCanvas(modifiedRegion);
expand.getDestCanvas()->copy( expand.getDestCanvas()->copy(