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,
ExpandCelCanvas::None);
// TODO can we reduce this region?
gfx::Region modifiedRegion(expand.getDestCanvas()->bounds());
// We cannot use cel->bounds() because cel->image() is nullptr
gfx::Rect modifiedRect(
cel->x(),
cel->y(),
image->width(),
image->height());
gfx::Region modifiedRegion(modifiedRect);
expand.validateDestCanvas(modifiedRegion);
expand.getDestCanvas()->copy(