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.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/js/tools/BrushTool.js b/js/tools/BrushTool.js
index 8b0f60bb..dd201f33 100644
--- a/js/tools/BrushTool.js
+++ b/js/tools/BrushTool.js
@@ -14,6 +14,8 @@ var ElementMediator = require("js/mediators/element-mediator").ElementMediator;
14var TagTool = require("js/tools/TagTool").TagTool; 14var TagTool = require("js/tools/TagTool").TagTool;
15var snapManager = require("js/helper-classes/3D/snap-manager").SnapManager; 15var snapManager = require("js/helper-classes/3D/snap-manager").SnapManager;
16 16
17var BrushStroke = require("js/lib/geom/brush-stroke").BrushStroke;
18
17exports.BrushTool = Montage.create(ShapeTool, { 19exports.BrushTool = Montage.create(ShapeTool, {
18 hasReel: { value: false }, 20 hasReel: { value: false },
19 _toolID: { value: "brushTool" }, 21 _toolID: { value: "brushTool" },
@@ -64,7 +66,7 @@ exports.BrushTool = Montage.create(ShapeTool, {
64 } 66 }
65 //start a new brush stroke 67 //start a new brush stroke
66 if (this._selectedBrushStroke === null){ 68 if (this._selectedBrushStroke === null){
67 this._selectedBrushStroke = new GLBrushStroke(); 69 this._selectedBrushStroke = new BrushStroke();
68 if (this.application.ninja.colorController.colorToolbar.stroke.webGlColor){ 70 if (this.application.ninja.colorController.colorToolbar.stroke.webGlColor){
69 this._selectedBrushStroke.setStrokeColor(this.application.ninja.colorController.colorToolbar.stroke.webGlColor); 71 this._selectedBrushStroke.setStrokeColor(this.application.ninja.colorController.colorToolbar.stroke.webGlColor);
70 } 72 }
@@ -205,7 +207,7 @@ exports.BrushTool = Montage.create(ShapeTool, {
205 var bboxMax = this._selectedBrushStroke.getBBoxMax(); 207 var bboxMax = this._selectedBrushStroke.getBBoxMax();
206 var bboxWidth = bboxMax[0] - bboxMin[0]; 208 var bboxWidth = bboxMax[0] - bboxMin[0];
207 var bboxHeight = bboxMax[1] - bboxMin[1]; 209 var bboxHeight = bboxMax[1] - bboxMin[1];
208 var bboxMid = Vector.create([0.5 * (bboxMax[0] + bboxMin[0]), 0.5 * (bboxMax[1] + bboxMin[1]), 0.5 * (bboxMax[2] + bboxMin[2])]); 210 var bboxMid = [0.5 * (bboxMax[0] + bboxMin[0]), 0.5 * (bboxMax[1] + bboxMin[1]), 0.5 * (bboxMax[2] + bboxMin[2])];
209 211
210 this._selectedBrushStroke.setCanvasX(bboxMid[0]); 212 this._selectedBrushStroke.setCanvasX(bboxMid[0]);
211 this._selectedBrushStroke.setCanvasY(bboxMid[1]); 213 this._selectedBrushStroke.setCanvasY(bboxMid[1]);