mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-10 12:44:53 +00:00
Fix cmd::TrimCel() for tilemaps when drawing tiles
This commit is contained in:
parent
8b1f887720
commit
0effbacd11
@ -1,5 +1,5 @@
|
|||||||
// Aseprite
|
// Aseprite
|
||||||
// Copyright (C) 2019 Igara Studio S.A.
|
// Copyright (C) 2019-2020 Igara Studio S.A.
|
||||||
// Copyright (C) 2016 David Capello
|
// Copyright (C) 2016 David Capello
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
@ -25,14 +25,13 @@ using namespace doc;
|
|||||||
|
|
||||||
TrimCel::TrimCel(Cel* cel)
|
TrimCel::TrimCel(Cel* cel)
|
||||||
{
|
{
|
||||||
gfx::Rect newBounds;
|
gfx::Rect newBounds = cel->bounds();
|
||||||
if (algorithm::shrink_bounds(cel->image(),
|
|
||||||
cel->image()->maskColor(),
|
if (algorithm::shrink_cel_bounds(cel,
|
||||||
cel->layer(), newBounds)) {
|
cel->image()->maskColor(),
|
||||||
newBounds.offset(cel->position());
|
newBounds)) {
|
||||||
if (cel->imageBounds() != newBounds) {
|
if (cel->bounds() != newBounds)
|
||||||
add(new cmd::CropCel(cel, newBounds));
|
add(new cmd::CropCel(cel, newBounds));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Delete the given "cel" and all its links.
|
// Delete the given "cel" and all its links.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user