aboutsummaryrefslogtreecommitdiff
path: root/js/tools/BrushTool.js
diff options
context:
space:
mode:
authorPushkar Joshi2012-03-06 17:04:40 -0800
committerPushkar Joshi2012-03-06 17:04:40 -0800
commit7a43958033906b2273de88bc2a26cda7a905d202 (patch)
treef71817e712c4b07a48257a4f0b206cf9033421df /js/tools/BrushTool.js
parent264e3d8e6d3624083d2fab9fe2560234553bb2ad (diff)
parent2e3943a8f751ec572066f168b58464c24b9f29e5 (diff)
downloadninja-7a43958033906b2273de88bc2a26cda7a905d202.tar.gz
Merge branch 'master' into brushtool
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]);