aboutsummaryrefslogtreecommitdiff
path: root/js/tools/BrushTool.js
diff options
context:
space:
mode:
authorEric Guzman2012-03-12 15:33:04 -0700
committerEric Guzman2012-03-12 15:33:04 -0700
commit7e3161153b87b891875ac65368a19aed12909fa3 (patch)
treeb80f48d711a9729fc39dbbdff28c4f0620e7302d /js/tools/BrushTool.js
parent7a28932ba8a7517bbaaabe1f5edf678416aafc9c (diff)
parent69d90467865a1384725b2301901be2180c5a841f (diff)
downloadninja-7e3161153b87b891875ac65368a19aed12909fa3.tar.gz
Merge branch 'refs/heads/master' into CSSPanelUpdates
Conflicts: js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js
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]);