Fix respect snap to grid when we move the selection (fix #4021)

This commit is contained in:
Gaspar Capello 2023-08-31 10:33:55 -03:00 committed by David Capello
parent 709545c57e
commit 3f8a8662fe

View File

@ -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
@ -441,7 +441,11 @@ void MovingPixelsState::onCommitMouseMove(Editor* editor,
KeyAction action = m_editor->getCustomizationDelegate()
->getPressedKeyAction(keyContext);
if (int(action & KeyAction::SnapToGrid))
bool snapToGrid = m_editor->docPref().grid.snap();
if (bool(action & KeyAction::SnapToGrid))
snapToGrid = !snapToGrid;
if (snapToGrid)
moveModifier |= PixelsMovement::SnapToGridMovement;
if (int(action & KeyAction::AngleSnap))