aboutsummaryrefslogtreecommitdiff
path: root/js/tools/LineTool.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/LineTool.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/LineTool.js')
-rwxr-xr-xjs/tools/LineTool.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/js/tools/LineTool.js b/js/tools/LineTool.js
index 0a7c0534..a61f8f79 100755
--- a/js/tools/LineTool.js
+++ b/js/tools/LineTool.js
@@ -13,6 +13,9 @@ var Montage = require("montage/core/core").Montage,
13 ShapesController = require("js/controllers/elements/shapes-controller").ShapesController, 13 ShapesController = require("js/controllers/elements/shapes-controller").ShapesController,
14 ShapeModel = require("js/models/shape-model").ShapeModel; 14 ShapeModel = require("js/models/shape-model").ShapeModel;
15 15
16var Line = require("js/lib/geom/line").Line;
17var MaterialsModel = require("js/models/materials-model").MaterialsModel;
18
16exports.LineTool = Montage.create(ShapeTool, { 19exports.LineTool = Montage.create(ShapeTool, {
17 _toolID: { value: "lineTool" }, 20 _toolID: { value: "lineTool" },
18 _imageID: { value: "lineToolImg" }, 21 _imageID: { value: "lineToolImg" },
@@ -206,10 +209,13 @@ exports.LineTool = Montage.create(ShapeTool, {
206 // for default stroke and fill/no materials 209 // for default stroke and fill/no materials
207 var strokeMaterial = null; 210 var strokeMaterial = null;
208 211
209 var strokeM = this.options.strokeMaterial; 212 if(this.options.use3D)
210 if(strokeM)
211 { 213 {
212 strokeMaterial = Object.create(MaterialsLibrary.getMaterial(strokeM)); 214 var strokeM = this.options.strokeMaterial;
215 if(strokeM)
216 {
217 strokeMaterial = Object.create(MaterialsModel.getMaterial(strokeM));
218 }
213 } 219 }
214 220
215 var world = this.getGLWorld(canvas, this.options.use3D); 221 var world = this.getGLWorld(canvas, this.options.use3D);
@@ -217,7 +223,7 @@ exports.LineTool = Montage.create(ShapeTool, {
217 var xOffset = ((left - canvas.offsetLeft + w/2) - canvas.width/2); 223 var xOffset = ((left - canvas.offsetLeft + w/2) - canvas.width/2);
218 var yOffset = (canvas.height/2 - (top - canvas.offsetTop + h/2)); 224 var yOffset = (canvas.height/2 - (top - canvas.offsetTop + h/2));
219 225
220 var line = new GLLine(world, xOffset, yOffset, w, h, slope, strokeSize, strokeColor, strokeMaterial, strokeStyle, xAdj, yAdj); 226 var line = new Line(world, xOffset, yOffset, w, h, slope, strokeSize, strokeColor, strokeMaterial, strokeStyle, xAdj, yAdj);
221 227
222 world.addObject(line); 228 world.addObject(line);
223 world.render(); 229 world.render();