Restore old "Add to selection" behavior (fix #1584)

Related to all issues named in:
https://community.aseprite.org/t/470/9
This commit is contained in:
David Capello 2017-10-03 15:03:51 -03:00
parent dede3610f3
commit 1d1636ffc8
5 changed files with 14 additions and 0 deletions

View File

@ -195,6 +195,7 @@
<option id="mode" type="SelectionMode" default="SelectionMode::DEFAULT" />
<option id="move_edges" type="bool" default="true" />
<option id="modifiers_disable_handles" type="bool" default="true" />
<option id="move_on_add_mode" type="bool" default="true" />
<option id="pivot_visibility" type="bool" default="false" />
<option id="pivot_position" type="PivotPosition" default="PivotPosition::CENTER" />
<option id="opaque" type="bool" default="false" />

View File

@ -341,6 +341,11 @@ If you press Shift/Ctrl/Alt keys, the handles
to transform the selection will be temporarily
disabled.
END
move_on_add_mode = Move selection on Add mode
move_on_add_mode_tooltip = <<<END
On "Add to selection" mode, we can move
the selection when the mouse is inside it.
END
autotimeline = Show timeline automatically
autotimeline_tooltip = <<<END
Show the timeline automatically

View File

@ -98,6 +98,7 @@
<check text="@.keep_selection_after_clear" id="keep_selection_after_clear" tooltip="@.keep_selection_after_clear_tooltip" />
<check text="@.move_edges" id="move_edges" tooltip="@.move_edges_tooltip" />
<check text="@.modifiers_disable_handles" id="modifiers_disable_handles" tooltip="@.modifiers_disable_handles_tooltip" />
<check text="@.move_on_add_mode" id="move_on_add_mode" tooltip="@.move_on_add_mode_tooltip" />
</vbox>
<!-- Timeline -->

View File

@ -201,6 +201,9 @@ public:
if (m_pref.selection.modifiersDisableHandles())
modifiersDisableHandles()->setSelected(true);
if (m_pref.selection.moveOnAddMode())
moveOnAddMode()->setSelected(true);
// If the platform supports native cursors...
if ((int(she::instance()->capabilities()) &
int(she::Capabilities::CustomNativeMouseCursor)) != 0) {
@ -390,6 +393,7 @@ public:
m_pref.selection.keepSelectionAfterClear(keepSelectionAfterClear()->isSelected());
m_pref.selection.moveEdges(moveEdges()->isSelected());
m_pref.selection.modifiersDisableHandles(modifiersDisableHandles()->isSelected());
m_pref.selection.moveOnAddMode(moveOnAddMode()->isSelected());
m_pref.guides.layerEdgesColor(layerEdgesColor()->getColor());
m_pref.guides.autoGuidesColor(autoGuidesColor()->getColor());
m_pref.slices.defaultColor(defaultSliceColor()->getColor());

View File

@ -1899,6 +1899,9 @@ bool Editor::canStartMovingSelectionPixels()
// enabled (we prefer to modify the selection on those modes
// instead of moving pixels).
((int(m_toolLoopModifiers) & int(tools::ToolLoopModifiers::kReplaceSelection)) ||
// We can move the selection on add mode if the preferences says so.
((int(m_toolLoopModifiers) & int(tools::ToolLoopModifiers::kAddSelection)) &&
Preferences::instance().selection.moveOnAddMode()) ||
// We can move the selection when the Copy selection key (Ctrl) is pressed.
(m_customizationDelegate &&
int(m_customizationDelegate->getPressedKeyAction(KeyContext::TranslatingSelection) & KeyAction::CopySelection)));