mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-20 13:21:05 +00:00
Don't activate square aspect when we start a Rectangular Marquee w/Shift modifier
Regression introduced in 21e893162d0a529019f75f91f3d7d25e2fdf55f0 to fix #2537
This commit is contained in:
parent
ca41785f18
commit
33db4281e7
@ -1556,28 +1556,35 @@ void Editor::updateToolLoopModifiersIndicators(const bool firstFromMouseDown)
|
|||||||
int(tools::ToolLoopModifiers::kSubtractSelection) |
|
int(tools::ToolLoopModifiers::kSubtractSelection) |
|
||||||
int(tools::ToolLoopModifiers::kIntersectSelection)));
|
int(tools::ToolLoopModifiers::kIntersectSelection)));
|
||||||
|
|
||||||
tools::Controller* controller =
|
tools::Tool* tool = atm->selectedTool();
|
||||||
(atm->selectedTool() ?
|
tools::Controller* controller = (tool ? tool->getController(0): nullptr);
|
||||||
atm->selectedTool()->getController(0): nullptr);
|
tools::Ink* ink = (tool ? tool->getInk(0): nullptr);
|
||||||
|
|
||||||
// Shape tools modifiers (line, curves, rectangles, etc.)
|
// Shape tools modifiers (line, curves, rectangles, etc.)
|
||||||
if (controller && controller->isTwoPoints()) {
|
if (controller && controller->isTwoPoints()) {
|
||||||
action = m_customizationDelegate->getPressedKeyAction(KeyContext::ShapeTool);
|
action = m_customizationDelegate->getPressedKeyAction(KeyContext::ShapeTool);
|
||||||
|
|
||||||
|
// For two-points-selection-like tools (Rectangular/Elliptical
|
||||||
|
// Marquee) we prefer to activate the
|
||||||
|
// square-aspect/rotation/etc. only when the user presses the
|
||||||
|
// modifier key again in the ToolLoop (and not before starting
|
||||||
|
// the loop). So Alt+selection will add a selection, but
|
||||||
|
// willn't start the square-aspect until we press Alt key
|
||||||
|
// again, or Alt+Shift+selection tool will subtract the
|
||||||
|
// selection but will not start the rotation until we release
|
||||||
|
// and press the Alt key again.
|
||||||
|
if (!firstFromMouseDown ||
|
||||||
|
!ink || !ink->isSelection()) {
|
||||||
if (int(action & KeyAction::MoveOrigin))
|
if (int(action & KeyAction::MoveOrigin))
|
||||||
modifiers |= int(tools::ToolLoopModifiers::kMoveOrigin);
|
modifiers |= int(tools::ToolLoopModifiers::kMoveOrigin);
|
||||||
if (int(action & KeyAction::SquareAspect))
|
if (int(action & KeyAction::SquareAspect))
|
||||||
modifiers |= int(tools::ToolLoopModifiers::kSquareAspect);
|
modifiers |= int(tools::ToolLoopModifiers::kSquareAspect);
|
||||||
if (int(action & KeyAction::DrawFromCenter))
|
if (int(action & KeyAction::DrawFromCenter))
|
||||||
modifiers |= int(tools::ToolLoopModifiers::kFromCenter);
|
modifiers |= int(tools::ToolLoopModifiers::kFromCenter);
|
||||||
|
if (int(action & KeyAction::RotateShape))
|
||||||
// We prefer to activate the rotation only when the user press
|
|
||||||
// the Alt key again in the ToolLoop (and not before starting
|
|
||||||
// the loop). So Alt+Shift+selection tool will subtract the
|
|
||||||
// selection but will not start the rotation until we release
|
|
||||||
// and press the Alt key again.
|
|
||||||
if ((int(action & KeyAction::RotateShape)) && !firstFromMouseDown)
|
|
||||||
modifiers |= int(tools::ToolLoopModifiers::kRotateShape);
|
modifiers |= int(tools::ToolLoopModifiers::kRotateShape);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Freehand modifiers
|
// Freehand modifiers
|
||||||
if (controller && controller->isFreehand()) {
|
if (controller && controller->isFreehand()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user