Skip to content

Commit

Permalink
Fix respect snap to grid when we move the selection (fix aseprite#4021)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gasparoken committed Aug 31, 2023
1 parent 572cdf2 commit f62bc39
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/app/ui/editor/moving_pixels_state.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Aseprite
// Copyright (C) 2019-2022 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
Expand Down Expand Up @@ -441,7 +441,11 @@ void MovingPixelsState::onCommitMouseMove(Editor* editor,
KeyAction action = m_editor->getCustomizationDelegate()
->getPressedKeyAction(keyContext);

if (int(action & KeyAction::SnapToGrid))
bool snapKeyAction = bool(action & KeyAction::SnapToGrid);
if (Preferences::instance().document(editor->document()).grid.snap())
snapKeyAction = !snapKeyAction;

if (snapKeyAction)
moveModifier |= PixelsMovement::SnapToGridMovement;

if (int(action & KeyAction::AngleSnap))
Expand Down

0 comments on commit f62bc39

Please sign in to comment.