Add option to disable Snap to Grid by default when we move the selection (fix #4153)

This commit is contained in:
David Capello 2023-11-20 15:18:00 -03:00
parent 8af4747635
commit fee543f9e1
4 changed files with 6 additions and 1 deletions

View File

@ -307,6 +307,7 @@
<option id="doubleclick_select_tile" type="bool" default="true" />
<option id="force_rotsprite" type="bool" default="false" />
<option id="multicel_when_layers_or_frames" type="bool" default="true" />
<option id="snap_to_grid" type="bool" default="true" />
</section>
<section id="quantization">
<option id="with_alpha" type="bool" default="true" />

View File

@ -1650,6 +1650,7 @@ frames, the transformation will be applied to all cels of the selected
layers/frames. Without this option, multiple cels will be transformed
only if you select multiple cels explicitly in the timeline.
END
snap_to_grid_selection = Snap To Grid when the option is enabled
autotimeline = Show timeline automatically
autotimeline_tooltip = <<<END
Show the timeline automatically

View File

@ -262,6 +262,8 @@
<check text="@.move_on_add_mode" id="move_on_add_mode" tooltip="@.move_on_add_mode_tooltip" />
<check text="@.select_tile_with_double_click" id="select_tile_with_double_click"
pref="selection.doubleclick_select_tile" />
<check text="@.snap_to_grid_selection"
pref="selection.snap_to_grid"/>
<check text="@.force_rotsprite" id="force_rotsprite"
pref="selection.force_rotsprite"/>
<check text="@.multicel_when_layers_or_frames" id="multicel_when_layers_or_frames"

View File

@ -441,7 +441,8 @@ void MovingPixelsState::onCommitMouseMove(Editor* editor,
KeyAction action = m_editor->getCustomizationDelegate()
->getPressedKeyAction(keyContext);
bool snapToGrid = m_editor->docPref().grid.snap();
bool snapToGrid = (Preferences::instance().selection.snapToGrid() &&
m_editor->docPref().grid.snap());
if (bool(action & KeyAction::SnapToGrid))
snapToGrid = !snapToGrid;