1
0
Fork 0
mirror of https://github.com/sbrl/Nibriboard.git synced 2018-01-10 21:33:49 +00:00

Implement pan & pointer tools

This commit is contained in:
Starbeamrainbowlabs 2017-06-26 16:57:26 +01:00
parent 1f4afe1f78
commit 247d3f3cc6
2 changed files with 9 additions and 2 deletions

View file

@ -355,7 +355,9 @@ class BoardWindow extends EventEmitter
handleCanvasMovement(event) {
// Don't bother processing it if it's a mouse / touch interaction and
// the control key isn't pressed
if([ "mouse", "touch" ].includes(event.type) && !this.keyboard.DownKeys.includes(17))
if([ "mouse", "touch" ].includes(event.type) &&
!this.keyboard.DownKeys.includes(17) &&
this.interface.currentTool !== "pan")
return;
// Store the viewport information for later
this.viewportState = event;

View file

@ -73,7 +73,9 @@ class Pencil
}
handleMouseMove(event) {
// todo add zoom support here
// Don't do anything at all if the brush tool isn't selected
if(this.boardWindow.interface.currentTool !== "brush")
return;
// Don't draw anything if the left mouse button isn't down
if(!this.mouse.leftDown)
@ -99,6 +101,9 @@ class Pencil
}
handleMouseUp(event) {
// Don't do anything at all if the brush tool isn't selected
if(this.boardWindow.interface.currentTool !== "brush")
return;
// Ignore it if the ctrl key is held down - see above
if(this.boardWindow.keyboard.DownKeys.includes(17))
return;