aboutsummaryrefslogtreecommitdiff
path: root/js/tools/OvalTool.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/OvalTool.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/OvalTool.js')
-rwxr-xr-xjs/tools/OvalTool.js23
1 files changed, 15 insertions, 8 deletions
diff --git a/js/tools/OvalTool.js b/js/tools/OvalTool.js
index e0f1f03f..14655312 100755
--- a/js/tools/OvalTool.js
+++ b/js/tools/OvalTool.js
@@ -43,16 +43,16 @@ exports.OvalTool = Montage.create(ShapeTool, {
43 var strokeMaterial = null; 43 var strokeMaterial = null;
44 var fillMaterial = null; 44 var fillMaterial = null;
45 45
46 var strokeIndex = parseInt(this.options.strokeMaterial); 46 var strokeM = this.options.strokeMaterial;
47 if(strokeIndex > 0) 47 if(strokeM)
48 { 48 {
49 strokeMaterial = Object.create(MaterialsLibrary.getMaterialAt(strokeIndex-1)); 49 strokeMaterial = Object.create(MaterialsLibrary.getMaterial(strokeM));
50 } 50 }
51 51
52 var fillIndex = parseInt(this.options.fillMaterial); 52 var fillM = this.options.fillMaterial;
53 if(fillIndex > 0) 53 if(fillM)
54 { 54 {
55 fillMaterial = Object.create(MaterialsLibrary.getMaterialAt(fillIndex-1)); 55 fillMaterial = Object.create(MaterialsLibrary.getMaterial(fillM));
56 } 56 }
57 57
58 58
@@ -75,18 +75,25 @@ exports.OvalTool = Montage.create(ShapeTool, {
75 canvas.elementModel.shapeModel.strokeSize = this.options.strokeSize.value + " " + this.options.strokeSize.units; 75 canvas.elementModel.shapeModel.strokeSize = this.options.strokeSize.value + " " + this.options.strokeSize.units;
76 canvas.elementModel.shapeModel.stroke = strokeColor; 76 canvas.elementModel.shapeModel.stroke = strokeColor;
77 canvas.elementModel.shapeModel.fill = fillColor; 77 canvas.elementModel.shapeModel.fill = fillColor;
78 if(strokeColor)
79 {
80 canvas.elementModel.shapeModel.border = this.application.ninja.colorController.colorToolbar.stroke;
81 }
82 if(fillColor)
83 {
84 canvas.elementModel.shapeModel.background = this.application.ninja.colorController.colorToolbar.fill;
85 }
78 86
79 canvas.elementModel.shapeModel.innerRadius = this.options.innerRadius.value + " " + this.options.innerRadius.units; 87 canvas.elementModel.shapeModel.innerRadius = this.options.innerRadius.value + " " + this.options.innerRadius.units;
80 88
81 canvas.elementModel.shapeModel.strokeMaterial = strokeMaterial; 89 canvas.elementModel.shapeModel.strokeMaterial = strokeMaterial;
82 canvas.elementModel.shapeModel.fillMaterial = fillMaterial; 90 canvas.elementModel.shapeModel.fillMaterial = fillMaterial;
83 canvas.elementModel.shapeModel.strokeMaterialIndex = strokeIndex;
84 canvas.elementModel.shapeModel.fillMaterialIndex = fillIndex;
85 91
86 canvas.elementModel.shapeModel.strokeStyleIndex = strokeStyleIndex; 92 canvas.elementModel.shapeModel.strokeStyleIndex = strokeStyleIndex;
87 canvas.elementModel.shapeModel.strokeStyle = strokeStyle; 93 canvas.elementModel.shapeModel.strokeStyle = strokeStyle;
88 94
89 canvas.elementModel.shapeModel.GLGeomObj = oval; 95 canvas.elementModel.shapeModel.GLGeomObj = oval;
96 canvas.elementModel.shapeModel.useWebGl = this.options.use3D;
90 } 97 }
91 else 98 else
92 { 99 {