aboutsummaryrefslogtreecommitdiff
path: root/js/tools/PenTool.js
diff options
context:
space:
mode:
authorPushkar Joshi2012-01-31 14:25:05 -0800
committerPushkar Joshi2012-01-31 14:25:05 -0800
commitc00d5d3072e487be200559f692ce4399222d5fa5 (patch)
treeedb985d043e3ce7fdbee1b6670656e91b5e7040b /js/tools/PenTool.js
parentc006b3e75d5e23da63687a04cd30bf56a3a8a80d (diff)
downloadninja-c00d5d3072e487be200559f692ce4399222d5fa5.tar.gz
handle the case of proper redraw when the alt key is held down even after mouse up
Diffstat (limited to 'js/tools/PenTool.js')
-rw-r--r--js/tools/PenTool.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/js/tools/PenTool.js b/js/tools/PenTool.js
index 46465be0..6aa5f3ab 100644
--- a/js/tools/PenTool.js
+++ b/js/tools/PenTool.js
@@ -417,7 +417,11 @@ exports.PenTool = Montage.create(ShapeTool, {
417 417
418 HandleLeftButtonUp: { 418 HandleLeftButtonUp: {
419 value: function (event) { 419 value: function (event) {
420 if (this._isDrawing) { 420 if (this._isAltDown) {
421 var point = webkitConvertPointFromPageToNode(this.application.ninja.stage.canvas, new WebKitPoint(event.pageX, event.pageY));
422 this.mouseUpHitRec = DrawingToolBase.getUpdatedSnapPoint(point.x, point.y, false, this.mouseDownHitRec);
423 }
424 else if (this._isDrawing) {
421 this.doDraw(event); //needed to get the mouse up point in case there was no mouse move 425 this.doDraw(event); //needed to get the mouse up point in case there was no mouse move
422 } 426 }
423 427
@@ -468,7 +472,7 @@ exports.PenTool = Montage.create(ShapeTool, {
468 if (this.application.ninja.colorController.colorToolbar.fill.webGlColor){ 472 if (this.application.ninja.colorController.colorToolbar.fill.webGlColor){
469 this._selectedSubpath.setFillColor(this.application.ninja.colorController.colorToolbar.fill.webGlColor); 473 this._selectedSubpath.setFillColor(this.application.ninja.colorController.colorToolbar.fill.webGlColor);
470 } 474 }
471 } 475 } //if this is a new path being rendered
472 476
473 this._selectedSubpath.makeDirty(); 477 this._selectedSubpath.makeDirty();
474 478