aboutsummaryrefslogtreecommitdiff
path: root/js/tools/LineTool.js
diff options
context:
space:
mode:
authorAnanya Sen2012-02-08 15:37:23 -0800
committerAnanya Sen2012-02-08 15:37:23 -0800
commitab6f2f7ada39a9b27408575af9a565daf0a9d291 (patch)
tree92a796e34530d1a724ddb24ef22e59ffef13c12a /js/tools/LineTool.js
parent36b2e540f06cef3887e7d0fea60527fee51e2a40 (diff)
parent5a69d5be181ea98fa842977885ebd8c861dda6ca (diff)
downloadninja-ab6f2f7ada39a9b27408575af9a565daf0a9d291.tar.gz
Merge branch 'FileIO' of github.com:joseeight/ninja-internal into FileIO
Diffstat (limited to 'js/tools/LineTool.js')
-rwxr-xr-xjs/tools/LineTool.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/js/tools/LineTool.js b/js/tools/LineTool.js
index 042ba0b2..99c374a7 100755
--- a/js/tools/LineTool.js
+++ b/js/tools/LineTool.js
@@ -99,6 +99,7 @@ exports.LineTool = Montage.create(ShapeTool, {
99 } 99 }
100 this.RenderShape(w, h, drawData.planeMat, drawData.midPt, 100 this.RenderShape(w, h, drawData.planeMat, drawData.midPt,
101 canvas, slope, xAdj, yAdj); 101 canvas, slope, xAdj, yAdj);
102 NJevent("elementAdded", canvas);
102 } 103 }
103 104
104 this.endDraw(event); 105 this.endDraw(event);
@@ -202,10 +203,10 @@ exports.LineTool = Montage.create(ShapeTool, {
202 // for default stroke and fill/no materials 203 // for default stroke and fill/no materials
203 var strokeMaterial = null; 204 var strokeMaterial = null;
204 205
205 var strokeIndex = parseInt(this.options.strokeMaterial); 206 var strokeM = this.options.strokeMaterial;
206 if(strokeIndex > 0) 207 if(strokeM)
207 { 208 {
208 strokeMaterial = Object.create(MaterialsLibrary.getMaterialAt(strokeIndex-1)); 209 strokeMaterial = Object.create(MaterialsLibrary.getMaterial(strokeM));
209 } 210 }
210 211
211 var world = this.getGLWorld(canvas, this.options.use3D); 212 var world = this.getGLWorld(canvas, this.options.use3D);
@@ -225,14 +226,18 @@ exports.LineTool = Montage.create(ShapeTool, {
225 canvas.elementModel.pi = "LinePi"; 226 canvas.elementModel.pi = "LinePi";
226 canvas.elementModel.shapeModel.strokeSize = this.options.strokeSize.value + " " + this.options.strokeSize.units; 227 canvas.elementModel.shapeModel.strokeSize = this.options.strokeSize.value + " " + this.options.strokeSize.units;
227 canvas.elementModel.shapeModel.stroke = strokeColor; 228 canvas.elementModel.shapeModel.stroke = strokeColor;
229 if(strokeColor)
230 {
231 canvas.elementModel.shapeModel.border = this.application.ninja.colorController.colorToolbar.stroke;
232 }
228 233
229 canvas.elementModel.shapeModel.strokeMaterial = strokeMaterial; 234 canvas.elementModel.shapeModel.strokeMaterial = strokeMaterial;
230 canvas.elementModel.shapeModel.strokeMaterialIndex = strokeIndex;
231 235
232 canvas.elementModel.shapeModel.strokeStyleIndex = strokeStyleIndex; 236 canvas.elementModel.shapeModel.strokeStyleIndex = strokeStyleIndex;
233 canvas.elementModel.shapeModel.strokeStyle = strokeStyle; 237 canvas.elementModel.shapeModel.strokeStyle = strokeStyle;
234 238
235 canvas.elementModel.shapeModel.GLGeomObj = line; 239 canvas.elementModel.shapeModel.GLGeomObj = line;
240 canvas.elementModel.shapeModel.useWebGl = this.options.use3D;
236 } 241 }
237 else 242 else
238 { 243 {