diff --git a/src/app/cmd/trim_cel.cpp b/src/app/cmd/trim_cel.cpp index 81cf979f8..8fe15e5b0 100644 --- a/src/app/cmd/trim_cel.cpp +++ b/src/app/cmd/trim_cel.cpp @@ -25,7 +25,10 @@ using namespace doc; TrimCel::TrimCel(Cel* cel) { gfx::Rect newBounds; - if (algorithm::shrink_cel_bounds(cel, cel->image()->maskColor(), newBounds)) { + if (algorithm::shrink_bounds(cel->image(), + cel->image()->maskColor(), + cel->layer(), newBounds)) { + newBounds.offset(cel->position()); if (cel->bounds() != newBounds) { add(new cmd::CropCel(cel, newBounds)); } diff --git a/src/app/util/clipboard.cpp b/src/app/util/clipboard.cpp index 21aeccd52..6cec39f5d 100644 --- a/src/app/util/clipboard.cpp +++ b/src/app/util/clipboard.cpp @@ -256,6 +256,7 @@ void clear_mask_from_cels(Tx& tx, cel = doc::get(celId); if (cel && cel->layer()->isTransparent() && + // Don't shrink tilemaps automatically !cel->layer()->isTilemap()) { tx(new cmd::TrimCel(cel)); }