aboutsummaryrefslogtreecommitdiff
path: root/js/tools/OvalTool.js
diff options
context:
space:
mode:
authorhwc4872012-06-29 15:22:53 -0700
committerhwc4872012-06-29 15:22:53 -0700
commit9f5901c76442df4d6dfff261706a4ef11c2f1536 (patch)
tree650ba70f1856a47328d35c485a96e89240529149 /js/tools/OvalTool.js
parent3df60279083f2cda60b3b871037c6d58454de5b2 (diff)
parentec69c8761f798eaf39c4a154997f8bc54b7e47f4 (diff)
downloadninja-9f5901c76442df4d6dfff261706a4ef11c2f1536.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into GridFixes
Diffstat (limited to 'js/tools/OvalTool.js')
-rwxr-xr-xjs/tools/OvalTool.js18
1 files changed, 12 insertions, 6 deletions
diff --git a/js/tools/OvalTool.js b/js/tools/OvalTool.js
index 33bf763d..e798d1a7 100755
--- a/js/tools/OvalTool.js
+++ b/js/tools/OvalTool.js
@@ -39,23 +39,24 @@ exports.OvalTool = Montage.create(ShapeTool, {
39 39
40 var innerRadius = this.options.innerRadius.value / 100; 40 var innerRadius = this.options.innerRadius.value / 100;
41 41
42 var strokeColor = this.options.stroke.webGlColor; 42 var strokeColor = this.options.stroke.webGlColor || [0,0,0,1];
43 var fillColor = this.options.fill.webGlColor; 43 var fillColor = this.options.fill.webGlColor || [1,1,1,1];
44
45 // for default stroke and fill/no materials 44 // for default stroke and fill/no materials
46 var strokeMaterial = null; 45 var strokeMaterial = null;
47 var fillMaterial = null; 46 var fillMaterial = null;
47 var fillM = null;
48 var strokeM = null;
48 49
49 if(this.options.use3D) 50 if(this.options.use3D)
50 { 51 {
51 var strokeM = this.options.strokeMaterial; 52 strokeM = this.options.strokeMaterial;
52 if(strokeM) 53 if(strokeM)
53 { 54 {
54 strokeMaterial = Object.create(MaterialsModel.getMaterial(strokeM)); 55 strokeMaterial = Object.create(MaterialsModel.getMaterial(strokeM));
55 } 56 }
56 strokeColor = ShapesController.getMaterialColor(strokeM) || strokeColor; 57 strokeColor = ShapesController.getMaterialColor(strokeM) || strokeColor;
57 58
58 var fillM = this.options.fillMaterial; 59 fillM = this.options.fillMaterial;
59 if(fillM) 60 if(fillM)
60 { 61 {
61 fillMaterial = Object.create(MaterialsModel.getMaterial(fillM)); 62 fillMaterial = Object.create(MaterialsModel.getMaterial(fillM));
@@ -95,7 +96,12 @@ exports.OvalTool = Montage.create(ShapeTool, {
95 } 96 }
96 97
97 // TODO - This needs to be moved into geom obj's init routine instead of here 98 // TODO - This needs to be moved into geom obj's init routine instead of here
98 this.setColor(this.options.stroke, this.options.fill, canvas, "ovalTool"); 99 if(!fillM) {
100 this.setColor(canvas, this.options.fill, true, "ovalTool");
101 }
102 if(!strokeM) {
103 this.setColor(canvas, this.options.stroke, false, "ovalTool");
104 }
99 105
100 if(canvas.elementModel.isShape) 106 if(canvas.elementModel.isShape)
101 { 107 {