aboutsummaryrefslogtreecommitdiff
path: root/js/tools/RectTool.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/tools/RectTool.js')
-rwxr-xr-xjs/tools/RectTool.js20
1 files changed, 12 insertions, 8 deletions
diff --git a/js/tools/RectTool.js b/js/tools/RectTool.js
index df049395..6f0e65c7 100755
--- a/js/tools/RectTool.js
+++ b/js/tools/RectTool.js
@@ -59,22 +59,24 @@ exports.RectTool = Montage.create(ShapeTool, {
59 var blRadius = ShapesController.GetValueInPixels(this.options.BLRadiusControl.value, this.options.BLRadiusControl.units, h); 59 var blRadius = ShapesController.GetValueInPixels(this.options.BLRadiusControl.value, this.options.BLRadiusControl.units, h);
60 var brRadius = ShapesController.GetValueInPixels(this.options.BRRadiusControl.value, this.options.BRRadiusControl.units, h); 60 var brRadius = ShapesController.GetValueInPixels(this.options.BRRadiusControl.value, this.options.BRRadiusControl.units, h);
61 61
62 var strokeColor = this.options.stroke.webGlColor; 62 var strokeColor = this.options.stroke.webGlColor || [0,0,0,1];
63 var fillColor = this.options.fill.webGlColor; 63 var fillColor = this.options.fill.webGlColor || [1,1,1,1];
64 // for default stroke and fill/no materials 64 // for default stroke and fill/no materials
65 var strokeMaterial = null; 65 var strokeMaterial = null;
66 var fillMaterial = null; 66 var fillMaterial = null;
67 var fillM = null;
68 var strokeM = null;
67 69
68 if(this.options.use3D) 70 if(this.options.use3D)
69 { 71 {
70 var strokeM = this.options.strokeMaterial; 72 strokeM = this.options.strokeMaterial;
71 if(strokeM) 73 if(strokeM)
72 { 74 {
73 strokeMaterial = Object.create(MaterialsModel.getMaterial(strokeM)); 75 strokeMaterial = Object.create(MaterialsModel.getMaterial(strokeM));
74 } 76 }
75 strokeColor = ShapesController.getMaterialColor(strokeM) || strokeColor; 77 strokeColor = ShapesController.getMaterialColor(strokeM) || strokeColor;
76 78
77 var fillM = this.options.fillMaterial; 79 fillM = this.options.fillMaterial;
78 if(fillM) 80 if(fillM)
79 { 81 {
80 fillMaterial = Object.create(MaterialsModel.getMaterial(fillM)); 82 fillMaterial = Object.create(MaterialsModel.getMaterial(fillM));
@@ -118,14 +120,16 @@ exports.RectTool = Montage.create(ShapeTool, {
118 } 120 }
119 121
120 // TODO - This needs to be moved into geom obj's init routine instead of here 122 // TODO - This needs to be moved into geom obj's init routine instead of here
121 this.setColor(this.options.stroke, this.options.fill, canvas, "rectTool"); 123 if(!fillM) {
122 124 this.setColor(canvas, this.options.fill, true, "rectTool");
125 }
126 if(!strokeM) {
127 this.setColor(canvas, this.options.stroke, false, "rectTool");
128 }
123 if(canvas.elementModel.isShape) 129 if(canvas.elementModel.isShape)
124 { 130 {
125 this.application.ninja.selectionController.selectElement(canvas); 131 this.application.ninja.selectionController.selectElement(canvas);
126 } 132 }
127
128
129 } 133 }
130 } 134 }
131}); \ No newline at end of file 135}); \ No newline at end of file