aboutsummaryrefslogtreecommitdiff
path: root/js/tools/OvalTool.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/tools/OvalTool.js')
-rwxr-xr-xjs/tools/OvalTool.js19
1 files changed, 14 insertions, 5 deletions
diff --git a/js/tools/OvalTool.js b/js/tools/OvalTool.js
index ce812398..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));
@@ -94,6 +95,14 @@ exports.OvalTool = Montage.create(ShapeTool, {
94 // TODO - update the shape's info only. shapeModel will likely need an array of shapes. 95 // TODO - update the shape's info only. shapeModel will likely need an array of shapes.
95 } 96 }
96 97
98 // TODO - This needs to be moved into geom obj's init routine instead of here
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 }
105
97 if(canvas.elementModel.isShape) 106 if(canvas.elementModel.isShape)
98 { 107 {
99 this.application.ninja.selectionController.selectElement(canvas); 108 this.application.ninja.selectionController.selectElement(canvas);