Fix reference layer scaled incorrectly after Sprite > Sprite Size (fix #3461)

master
Gaspar Capello 2022-08-08 15:39:27 -03:00 committed by David Capello
parent add1128248
commit 19b18d2a63
1 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,5 @@
// Aseprite
// Copyright (c) 2019-2020 Igara Studio S.A.
// Copyright (c) 2019-2022 Igara Studio S.A.
//
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
@ -64,9 +64,9 @@ void resize_cel_image(
// Resize the cel bounds only if it's from a reference layer
if (cel->layer()->isReference()) {
gfx::RectF newBounds = cel->boundsF();
newBounds.offset(-pivot);
newBounds *= scale;
newBounds.offset(pivot);
newBounds.offset(pivot - gfx::PointF(scale.w*pivot.x, scale.h*pivot.y));
newBounds.w *= scale.w;
newBounds.h *= scale.h;
tx(new cmd::SetCelBoundsF(cel, newBounds));
}
else {