Skip to content

Commit

Permalink
use shift and ctrl for translation and rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
r03ert0 committed Oct 30, 2019
1 parent 0098692 commit 62a29d6
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/editor/Editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,15 @@ class Editor {
}

private onMouseDown(event: MouseEvent) {
switch(event.button) {
case 0:
if (this.handles.onMouseDown(event)) {
this.mouseMode = MouseMode.Left;
}
break;
case 1: this.mouseMode = MouseMode.Middle; break;
case 2: this.mouseMode = MouseMode.Right; break;
const {ctrlKey, shiftKey} = event;
if(event.button === 0 && !ctrlKey && !shiftKey) {
if (this.handles.onMouseDown(event)) {
this.mouseMode = MouseMode.Left;
}
} else if(event.button === 1 || shiftKey) {
this.mouseMode = MouseMode.Middle;
} else if(event.button === 2 || ctrlKey) {
this.mouseMode = MouseMode.Right;
}
event.preventDefault();
}
Expand Down

0 comments on commit 62a29d6

Please sign in to comment.