From 46fb52be241dced940d46629c809a09c86ed4438 Mon Sep 17 00:00:00 2001 From: Pushkar Joshi Date: Wed, 29 Feb 2012 11:38:33 -0800 Subject: changed the registration point of the brush tool icon and added a temporary check to prevent extremely long brush strokes --- js/tools/BrushTool.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'js/tools/BrushTool.js') diff --git a/js/tools/BrushTool.js b/js/tools/BrushTool.js index 776d914c..fec89eb2 100644 --- a/js/tools/BrushTool.js +++ b/js/tools/BrushTool.js @@ -67,6 +67,10 @@ exports.BrushTool = Montage.create(ShapeTool, { if (this.application.ninja.colorController.colorToolbar.stroke.webGlColor){ this._selectedBrushStroke.setStrokeColor(this.application.ninja.colorController.colorToolbar.stroke.webGlColor); } + //add this point to the brush stroke in case the user does a mouse up before doing a mouse move + var currMousePos = this._getUnsnappedPosition(event.pageX, event.pageY); + this._selectedBrushStroke.addPoint(currMousePos); + //TODO get these values from the options this._selectedBrushStroke.setStrokeWidth(20); } @@ -108,7 +112,7 @@ exports.BrushTool = Montage.create(ShapeTool, { if (this._isDrawing) { var currMousePos = this._getUnsnappedPosition(event.pageX, event.pageY); - if (this._selectedBrushStroke){ + if (this._selectedBrushStroke && this._selectedBrushStroke.getNumPoints()<100){ this._selectedBrushStroke.addPoint(currMousePos); } this.ShowCurrentBrushStrokeOnStage(); -- cgit v1.2.3