From c00d5d3072e487be200559f692ce4399222d5fa5 Mon Sep 17 00:00:00 2001 From: Pushkar Joshi Date: Tue, 31 Jan 2012 14:25:05 -0800 Subject: handle the case of proper redraw when the alt key is held down even after mouse up --- js/tools/PenTool.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'js/tools') 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, { HandleLeftButtonUp: { value: function (event) { - if (this._isDrawing) { + if (this._isAltDown) { + var point = webkitConvertPointFromPageToNode(this.application.ninja.stage.canvas, new WebKitPoint(event.pageX, event.pageY)); + this.mouseUpHitRec = DrawingToolBase.getUpdatedSnapPoint(point.x, point.y, false, this.mouseDownHitRec); + } + else if (this._isDrawing) { this.doDraw(event); //needed to get the mouse up point in case there was no mouse move } @@ -468,7 +472,7 @@ exports.PenTool = Montage.create(ShapeTool, { if (this.application.ninja.colorController.colorToolbar.fill.webGlColor){ this._selectedSubpath.setFillColor(this.application.ninja.colorController.colorToolbar.fill.webGlColor); } - } + } //if this is a new path being rendered this._selectedSubpath.makeDirty(); -- cgit v1.2.3