aboutsummaryrefslogtreecommitdiff
path: root/js/tools/BrushTool.js
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-03-12 16:25:28 -0700
committerNivesh Rajbhandari2012-03-12 16:25:28 -0700
commit5fb358d9e80a364d5f300d60b7a9fe0f773741e7 (patch)
tree2c4d5292b19c91697dffb542f369ec9dcb340f77 /js/tools/BrushTool.js
parent5f9b67be3b8bdb391d021103c6bcee6be2f6cdf4 (diff)
parent69d90467865a1384725b2301901be2180c5a841f (diff)
downloadninja-5fb358d9e80a364d5f300d60b7a9fe0f773741e7.tar.gz
Merge branch 'refs/heads/ninja-internal' into ToolFixes
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]);