Skip to content

Commit

Permalink
Fix after dropping a selection via Copy (Selection + Ctrl), handlers …
Browse files Browse the repository at this point in the history
…are not positioned correctly (fix aseprite#3977)

This fix disables FineControl when the transformation doesn't include
rotation or skew.
Also this fix improves the regular movement of selected image.
  • Loading branch information
Gasparoken committed Jul 31, 2023
1 parent ab2d7f7 commit 3a54ab0
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/app/ui/editor/pixels_movement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,12 +375,8 @@ void PixelsMovement::moveImage(const gfx::PointF& pos, MoveModifier moveModifier
switch (m_handle) {

case MovePixelsHandle: {
double dx = (pos.x - m_catchPos.x);
double dy = (pos.y - m_catchPos.y);
if ((moveModifier & FineControl) == 0) {
if (dx >= 0.0) { dx = std::floor(dx); } else { dx = std::ceil(dx); }
if (dy >= 0.0) { dy = std::floor(dy); } else { dy = std::ceil(dy); }
}
double dx = (std::floor(pos.x) - std::floor(m_catchPos.x));
double dy = (std::floor(pos.y) - std::floor(m_catchPos.y));

if ((moveModifier & LockAxisMovement) == LockAxisMovement) {
if (std::abs(dx) < std::abs(dy))
Expand Down

0 comments on commit 3a54ab0

Please sign in to comment.