Skip to content

Commit

Permalink
Enhancement canvas mirror sides (fix #1826)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gasparoken authored and dacap committed Sep 17, 2018
1 parent 9b259a7 commit c05c3da
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/app/ui/editor/select_box_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,22 @@ bool SelectBoxState::onMouseMove(Editor* editor, MouseMessage* msg)
for (int i : m_movingRulers) {
Ruler& ruler = m_rulers[i];
const Ruler& start = m_startRulers[i];
int oppositeRuler = i^1;// 0 and 1 are opposites, and 2 and 3
Ruler& oppRuler = m_rulers[oppositeRuler];

switch (ruler.orientation()) {
case Ruler::Horizontal: ruler.setPosition(start.position() + delta.y); break;
case Ruler::Vertical: ruler.setPosition(start.position() + delta.x); break;
case Ruler::Horizontal:
ruler.setPosition(start.position() + delta.y);
if (msg->modifiers() == os::kKeyShiftModifier)
oppRuler.setPosition(editor->sprite()->height()
- start.position() - delta.y);
break;
case Ruler::Vertical:
ruler.setPosition(start.position() + delta.x);
if (msg->modifiers() == os::kKeyShiftModifier)
oppRuler.setPosition(editor->sprite()->width()
- start.position() - delta.x);
break;
}
}
used = true;
Expand Down

0 comments on commit c05c3da

Please sign in to comment.