aboutsummaryrefslogtreecommitdiff
path: root/js/tools/BrushTool.js
diff options
context:
space:
mode:
authorPushkar Joshi2012-02-29 11:38:33 -0800
committerPushkar Joshi2012-02-29 11:38:33 -0800
commit46fb52be241dced940d46629c809a09c86ed4438 (patch)
tree7e8462aeb86c8d579efbbd1ae6688d594e82bcbd /js/tools/BrushTool.js
parentf000a3cced9adbfff1d7aa641e6eb42ad6edf7e8 (diff)
downloadninja-46fb52be241dced940d46629c809a09c86ed4438.tar.gz
changed the registration point of the brush tool icon and
added a temporary check to prevent extremely long brush strokes
Diffstat (limited to 'js/tools/BrushTool.js')
-rw-r--r--js/tools/BrushTool.js6
1 files changed, 5 insertions, 1 deletions
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, {
67 if (this.application.ninja.colorController.colorToolbar.stroke.webGlColor){ 67 if (this.application.ninja.colorController.colorToolbar.stroke.webGlColor){
68 this._selectedBrushStroke.setStrokeColor(this.application.ninja.colorController.colorToolbar.stroke.webGlColor); 68 this._selectedBrushStroke.setStrokeColor(this.application.ninja.colorController.colorToolbar.stroke.webGlColor);
69 } 69 }
70 //add this point to the brush stroke in case the user does a mouse up before doing a mouse move
71 var currMousePos = this._getUnsnappedPosition(event.pageX, event.pageY);
72 this._selectedBrushStroke.addPoint(currMousePos);
73
70 //TODO get these values from the options 74 //TODO get these values from the options
71 this._selectedBrushStroke.setStrokeWidth(20); 75 this._selectedBrushStroke.setStrokeWidth(20);
72 } 76 }
@@ -108,7 +112,7 @@ exports.BrushTool = Montage.create(ShapeTool, {
108 112
109 if (this._isDrawing) { 113 if (this._isDrawing) {
110 var currMousePos = this._getUnsnappedPosition(event.pageX, event.pageY); 114 var currMousePos = this._getUnsnappedPosition(event.pageX, event.pageY);
111 if (this._selectedBrushStroke){ 115 if (this._selectedBrushStroke && this._selectedBrushStroke.getNumPoints()<100){
112 this._selectedBrushStroke.addPoint(currMousePos); 116 this._selectedBrushStroke.addPoint(currMousePos);
113 } 117 }
114 this.ShowCurrentBrushStrokeOnStage(); 118 this.ShowCurrentBrushStrokeOnStage();