mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-16 19:21:12 +00:00
Fix move symmetry when zoom tool is active (fix #1845)
This commit is contained in:
parent
6eaebefb90
commit
7b4609d2d1
@ -138,6 +138,24 @@ bool StandbyState::onMouseDown(Editor* editor, MouseMessage* msg)
|
||||
// When an editor is clicked the current view is changed.
|
||||
context->setActiveView(editor->getDocView());
|
||||
|
||||
// Move symmetry
|
||||
Decorator::Handles handles;
|
||||
if (m_decorator->getSymmetryHandles(editor, handles)) {
|
||||
for (const auto& handle : handles) {
|
||||
if (handle.bounds.contains(msg->position())) {
|
||||
auto mode = (handle.align & (TOP | BOTTOM) ? app::gen::SymmetryMode::HORIZONTAL:
|
||||
app::gen::SymmetryMode::VERTICAL);
|
||||
bool horz = (mode == app::gen::SymmetryMode::HORIZONTAL);
|
||||
auto& symmetry = Preferences::instance().document(editor->document()).symmetry;
|
||||
auto& axis = (horz ? symmetry.xAxis:
|
||||
symmetry.yAxis);
|
||||
editor->setState(
|
||||
EditorStatePtr(new MovingSymmetryState(editor, msg, mode, axis)));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Start scroll loop
|
||||
if (editor->checkForScroll(msg) ||
|
||||
editor->checkForZoom(msg))
|
||||
@ -297,24 +315,6 @@ bool StandbyState::onMouseDown(Editor* editor, MouseMessage* msg)
|
||||
}
|
||||
}
|
||||
|
||||
// Move symmetry
|
||||
Decorator::Handles handles;
|
||||
if (m_decorator->getSymmetryHandles(editor, handles)) {
|
||||
for (const auto& handle : handles) {
|
||||
if (handle.bounds.contains(msg->position())) {
|
||||
auto mode = (handle.align & (TOP | BOTTOM) ? app::gen::SymmetryMode::HORIZONTAL:
|
||||
app::gen::SymmetryMode::VERTICAL);
|
||||
bool horz = (mode == app::gen::SymmetryMode::HORIZONTAL);
|
||||
auto& symmetry = Preferences::instance().document(editor->document()).symmetry;
|
||||
auto& axis = (horz ? symmetry.xAxis:
|
||||
symmetry.yAxis);
|
||||
editor->setState(
|
||||
EditorStatePtr(new MovingSymmetryState(editor, msg, mode, axis)));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Start the Tool-Loop
|
||||
if (layer && (layer->isImage() || clickedInk->isSelection())) {
|
||||
// Shift+click on Pencil tool starts a line onMouseDown() when the
|
||||
|
Loading…
x
Reference in New Issue
Block a user