mirror of
https://github.com/aseprite/aseprite.git
synced 2024-10-06 14:59:50 +00:00
Fix new bounds of tilemap after Edit > Clear or Edit > Cut
This commit is contained in:
parent
26139c4ae2
commit
4c583c2619
@ -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));
|
||||
}
|
||||
|
@ -256,6 +256,7 @@ void clear_mask_from_cels(Tx& tx,
|
||||
cel = doc::get<Cel>(celId);
|
||||
if (cel &&
|
||||
cel->layer()->isTransparent() &&
|
||||
// Don't shrink tilemaps automatically
|
||||
!cel->layer()->isTilemap()) {
|
||||
tx(new cmd::TrimCel(cel));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user