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