1
0
Fork 0

[client] Keep the pencil off the page if the ctrl key is held down (for panning)

This commit is contained in:
Starbeamrainbowlabs 2017-04-24 21:49:07 +01:00
parent d0ed30b6d3
commit 9e391a90d9
1 changed files with 10 additions and 0 deletions

View File

@ -57,6 +57,12 @@ class Pencil
// Don't draw anything if the left mouse button isn't down
if(!this.mouse.leftDown)
return;
// Oh and don't bother drawing anything if the control key is held down
// either - that indicates that we're in panning mode
// todo Create a tools systme where you can select a panning tool
// too / instead...?
if(this.boardWindow.keyboard.DownKeys.includes(17))
return;
var nextPoint = new Vector(
event.clientX + this.boardWindow.viewport.x,
@ -71,6 +77,10 @@ class Pencil
}
handleMouseUp(event) {
// Ignore it if the ctrl key is held down - see above
if(this.boardWindow.keyboard.DownKeys.includes(17))
return;
this.sendUnsent();
// Tell the server that the line is complete
this.rippleLink.send({