mirror of
https://github.com/sbrl/Nibriboard.git
synced 2018-01-10 21:33:49 +00:00
[client] Keep the pencil off the page if the ctrl key is held down (for panning)
This commit is contained in:
parent
d0ed30b6d3
commit
9e391a90d9
1 changed files with 10 additions and 0 deletions
|
@ -57,6 +57,12 @@ class Pencil
|
||||||
// Don't draw anything if the left mouse button isn't down
|
// Don't draw anything if the left mouse button isn't down
|
||||||
if(!this.mouse.leftDown)
|
if(!this.mouse.leftDown)
|
||||||
return;
|
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(
|
var nextPoint = new Vector(
|
||||||
event.clientX + this.boardWindow.viewport.x,
|
event.clientX + this.boardWindow.viewport.x,
|
||||||
|
@ -71,6 +77,10 @@ class Pencil
|
||||||
}
|
}
|
||||||
|
|
||||||
handleMouseUp(event) {
|
handleMouseUp(event) {
|
||||||
|
// Ignore it if the ctrl key is held down - see above
|
||||||
|
if(this.boardWindow.keyboard.DownKeys.includes(17))
|
||||||
|
return;
|
||||||
|
|
||||||
this.sendUnsent();
|
this.sendUnsent();
|
||||||
// Tell the server that the line is complete
|
// Tell the server that the line is complete
|
||||||
this.rippleLink.send({
|
this.rippleLink.send({
|
||||||
|
|
Loading…
Reference in a new issue