mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-01 10:21:04 +00:00
Improve Shift+mouse drag in Canvas Size
Change rulers in a symmetric way from the starting ruler positions instead from the canvas.
This commit is contained in:
parent
c7955337c2
commit
93a858b486
@ -191,25 +191,27 @@ bool SelectBoxState::onMouseMove(Editor* editor, MouseMessage* msg)
|
|||||||
Ruler& oppRuler = oppositeRuler(i);
|
Ruler& oppRuler = oppositeRuler(i);
|
||||||
|
|
||||||
switch (ruler.align() & (HORIZONTAL | VERTICAL)) {
|
switch (ruler.align() & (HORIZONTAL | VERTICAL)) {
|
||||||
|
|
||||||
case HORIZONTAL:
|
case HORIZONTAL:
|
||||||
if (hasFlag(Flags::PaddingRulers) && (i == H2)) {
|
if (hasFlag(Flags::PaddingRulers) && (i == H2)) {
|
||||||
int pad = m_rulers[PH].position() - m_rulers[H2].position();
|
int pad = m_rulers[PH].position() - m_rulers[H2].position();
|
||||||
m_rulers[PH].setPosition(start.position() + delta.y + pad);
|
m_rulers[PH].setPosition(start.position() + delta.y + pad);
|
||||||
}
|
}
|
||||||
|
|
||||||
ruler.setPosition(start.position() + delta.y);
|
ruler.setPosition(start.position() + delta.y);
|
||||||
if (msg->modifiers() == os::kKeyShiftModifier)
|
if (msg->modifiers() == os::kKeyShiftModifier)
|
||||||
oppRuler.setPosition(editor->sprite()->height()
|
oppRuler.setPosition(m_startRulers[i ^ 1].position() - delta.y);
|
||||||
- start.position() - delta.y);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VERTICAL:
|
case VERTICAL:
|
||||||
if (hasFlag(Flags::PaddingRulers) && (i == V2)) {
|
if (hasFlag(Flags::PaddingRulers) && (i == V2)) {
|
||||||
int pad = m_rulers[PV].position() - m_rulers[V2].position();
|
int pad = m_rulers[PV].position() - m_rulers[V2].position();
|
||||||
m_rulers[PV].setPosition(start.position() + delta.x + pad);
|
m_rulers[PV].setPosition(start.position() + delta.x + pad);
|
||||||
}
|
}
|
||||||
|
|
||||||
ruler.setPosition(start.position() + delta.x);
|
ruler.setPosition(start.position() + delta.x);
|
||||||
if (msg->modifiers() == os::kKeyShiftModifier)
|
if (msg->modifiers() == os::kKeyShiftModifier)
|
||||||
oppRuler.setPosition(editor->sprite()->width()
|
oppRuler.setPosition(m_startRulers[i ^ 1].position() - delta.x);
|
||||||
- start.position() - delta.x);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user