mirror of
https://github.com/aseprite/aseprite.git
synced 2024-10-06 23:09:58 +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)
|
TrimCel::TrimCel(Cel* cel)
|
||||||
{
|
{
|
||||||
gfx::Rect newBounds;
|
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) {
|
if (cel->bounds() != newBounds) {
|
||||||
add(new cmd::CropCel(cel, newBounds));
|
add(new cmd::CropCel(cel, newBounds));
|
||||||
}
|
}
|
||||||
|
@ -256,6 +256,7 @@ void clear_mask_from_cels(Tx& tx,
|
|||||||
cel = doc::get<Cel>(celId);
|
cel = doc::get<Cel>(celId);
|
||||||
if (cel &&
|
if (cel &&
|
||||||
cel->layer()->isTransparent() &&
|
cel->layer()->isTransparent() &&
|
||||||
|
// Don't shrink tilemaps automatically
|
||||||
!cel->layer()->isTilemap()) {
|
!cel->layer()->isTilemap()) {
|
||||||
tx(new cmd::TrimCel(cel));
|
tx(new cmd::TrimCel(cel));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user