diff options
Diffstat (limited to 'js/tools/OvalTool.js')
-rwxr-xr-x | js/tools/OvalTool.js | 18 |
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 | { |