aboutsummaryrefslogtreecommitdiff
path: root/js/tools/BrushTool.js
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-03-06 14:09:44 -0800
committerNivesh Rajbhandari2012-03-06 14:09:44 -0800
commit792793cd3991032b4840ade67f98ae8eae2d30a0 (patch)
tree69d3df003d2bb58fa1ab562fbd1058ff91851f01 /js/tools/BrushTool.js
parent2346d8ab9db06573d8672c64988c46b6c672e015 (diff)
parent1cd89d4d06e3a8f2c221628b19cf26a2c69f5d3f (diff)
downloadninja-792793cd3991032b4840ade67f98ae8eae2d30a0.tar.gz
Merge branch 'refs/heads/ninja-internal' into WebGLFixes
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 fec89eb2..752aa2a3 100644
--- a/js/tools/BrushTool.js
+++ b/js/tools/BrushTool.js
@@ -13,6 +13,8 @@ var ElementMediator = require("js/mediators/element-mediator").ElementMediator;
13var TagTool = require("js/tools/TagTool").TagTool; 13var TagTool = require("js/tools/TagTool").TagTool;
14var snapManager = require("js/helper-classes/3D/snap-manager").SnapManager; 14var snapManager = require("js/helper-classes/3D/snap-manager").SnapManager;
15 15
16var BrushStroke = require("js/lib/geom/brush-stroke").BrushStroke;
17
16exports.BrushTool = Montage.create(ShapeTool, { 18exports.BrushTool = Montage.create(ShapeTool, {
17 hasReel: { value: false }, 19 hasReel: { value: false },
18 _toolID: { value: "brushTool" }, 20 _toolID: { value: "brushTool" },
@@ -63,7 +65,7 @@ exports.BrushTool = Montage.create(ShapeTool, {
63 } 65 }
64 //start a new brush stroke 66 //start a new brush stroke
65 if (this._selectedBrushStroke === null){ 67 if (this._selectedBrushStroke === null){
66 this._selectedBrushStroke = new GLBrushStroke(); 68 this._selectedBrushStroke = new BrushStroke();
67 if (this.application.ninja.colorController.colorToolbar.stroke.webGlColor){ 69 if (this.application.ninja.colorController.colorToolbar.stroke.webGlColor){
68 this._selectedBrushStroke.setStrokeColor(this.application.ninja.colorController.colorToolbar.stroke.webGlColor); 70 this._selectedBrushStroke.setStrokeColor(this.application.ninja.colorController.colorToolbar.stroke.webGlColor);
69 } 71 }
@@ -192,7 +194,7 @@ exports.BrushTool = Montage.create(ShapeTool, {
192 var bboxMax = this._selectedBrushStroke.getBBoxMax(); 194 var bboxMax = this._selectedBrushStroke.getBBoxMax();
193 var bboxWidth = bboxMax[0] - bboxMin[0]; 195 var bboxWidth = bboxMax[0] - bboxMin[0];
194 var bboxHeight = bboxMax[1] - bboxMin[1]; 196 var bboxHeight = bboxMax[1] - bboxMin[1];
195 var bboxMid = Vector.create([0.5 * (bboxMax[0] + bboxMin[0]), 0.5 * (bboxMax[1] + bboxMin[1]), 0.5 * (bboxMax[2] + bboxMin[2])]); 197 var bboxMid = [0.5 * (bboxMax[0] + bboxMin[0]), 0.5 * (bboxMax[1] + bboxMin[1]), 0.5 * (bboxMax[2] + bboxMin[2])];
196 198
197 this._selectedBrushStroke.setCanvasX(bboxMid[0]); 199 this._selectedBrushStroke.setCanvasX(bboxMid[0]);
198 this._selectedBrushStroke.setCanvasY(bboxMid[1]); 200 this._selectedBrushStroke.setCanvasY(bboxMid[1]);