Fix selected image is modified by moving the pivot point in certain positions (fix #3901)

Prior to this fix, there was a spurious movement on a selected image
simply by moving the pivot point. Steps to reproduce it:

- Select a canvas area
- Zoom at 300%
- Make the pivot visible and move it to a negative coordinate
  position (less than the origin 0,0)
- If you rotate/skew the image this problem cannot be reproduced
This commit is contained in:
Gaspar Capello 2023-06-05 11:04:49 -03:00 committed by David Capello
parent a628bbb58b
commit da90a57ce0

View File

@ -1,5 +1,5 @@
// Aseprite
// Copyright (C) 2019-2021 Igara Studio S.A.
// Copyright (C) 2019-2023 Igara Studio S.A.
// Copyright (C) 2001-2018 David Capello
//
// This program is distributed under the terms of
@ -699,7 +699,7 @@ void PixelsMovement::moveImage(const gfx::PointF& pos, MoveModifier moveModifier
case PivotHandle: {
// Calculate the new position of the pivot
gfx::PointF newPivot = m_initialData.pivot() + pos - m_catchPos;
gfx::PointF newPivot = m_initialData.pivot() + gfx::Point(pos) - m_catchPos;
newTransformation = m_initialData;
newTransformation.displacePivotTo(newPivot);
break;