aboutsummaryrefslogtreecommitdiff
path: root/js/tools/BrushTool.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/tools/BrushTool.js')
-rw-r--r--js/tools/BrushTool.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/js/tools/BrushTool.js b/js/tools/BrushTool.js
index 9a0ad583..776d914c 100644
--- a/js/tools/BrushTool.js
+++ b/js/tools/BrushTool.js
@@ -64,6 +64,11 @@ exports.BrushTool = Montage.create(ShapeTool, {
64 //start a new brush stroke 64 //start a new brush stroke
65 if (this._selectedBrushStroke === null){ 65 if (this._selectedBrushStroke === null){
66 this._selectedBrushStroke = new GLBrushStroke(); 66 this._selectedBrushStroke = new GLBrushStroke();
67 if (this.application.ninja.colorController.colorToolbar.stroke.webGlColor){
68 this._selectedBrushStroke.setStrokeColor(this.application.ninja.colorController.colorToolbar.stroke.webGlColor);
69 }
70 //TODO get these values from the options
71 this._selectedBrushStroke.setStrokeWidth(20);
67 } 72 }
68 NJevent("enableStageMove");//stageManagerModule.stageManager.enableMouseMove(); 73 NJevent("enableStageMove");//stageManagerModule.stageManager.enableMouseMove();
69 } //value: function (event) { 74 } //value: function (event) {
@@ -132,10 +137,7 @@ exports.BrushTool = Montage.create(ShapeTool, {
132 this._isDrawing = false; 137 this._isDrawing = false;
133 this._hasDraw = false; 138 this._hasDraw = false;
134 139
135 //TODO get these values from the options 140
136 if (this._selectedBrushStroke){
137 this._selectedBrushStroke.setStrokeWidth(20);
138 }
139 //display the previously drawn stroke in a separate canvas 141 //display the previously drawn stroke in a separate canvas
140 this.RenderCurrentBrushStroke(); 142 this.RenderCurrentBrushStroke();
141 143
@@ -150,7 +152,7 @@ exports.BrushTool = Montage.create(ShapeTool, {
150 //clear the canvas before we draw anything else 152 //clear the canvas before we draw anything else
151 this.application.ninja.stage.clearDrawingCanvas(); 153 this.application.ninja.stage.clearDrawingCanvas();
152 if (this._selectedBrushStroke && this._selectedBrushStroke.getNumPoints()>0){ 154 if (this._selectedBrushStroke && this._selectedBrushStroke.getNumPoints()>0){
153 this._selectedBrushStroke.computeMetaGeometry(); 155 //this._selectedBrushStroke.computeMetaGeometry();
154 var ctx = this.application.ninja.stage.drawingContext;//stageManagerModule.stageManager.drawingContext; 156 var ctx = this.application.ninja.stage.drawingContext;//stageManagerModule.stageManager.drawingContext;
155 if (ctx === null) 157 if (ctx === null)
156 throw ("null drawing context in Brushtool::ShowCurrentBrushStrokeOnStage"); 158 throw ("null drawing context in Brushtool::ShowCurrentBrushStrokeOnStage");