From 3159acdc5c3a9c8843bffce5504624b616aa5c99 Mon Sep 17 00:00:00 2001 From: David Capello Date: Thu, 25 Jun 2015 17:36:14 -0300 Subject: [PATCH] Reduce the area generated for cmd::CopyRegion when we move a selection --- src/app/ui/editor/pixels_movement.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/app/ui/editor/pixels_movement.cpp b/src/app/ui/editor/pixels_movement.cpp index 12a408d1e..e70c03bce 100644 --- a/src/app/ui/editor/pixels_movement.cpp +++ b/src/app/ui/editor/pixels_movement.cpp @@ -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(