aboutsummaryrefslogtreecommitdiff
path: root/js/tools/RectTool.js
diff options
context:
space:
mode:
authorArmen Kesablyan2012-07-02 13:19:20 -0700
committerArmen Kesablyan2012-07-02 13:19:20 -0700
commit526b9d76686323f488f1b26175440172b715d808 (patch)
tree47fc6bd90715b403a08d08a48a86f4d24da1ba29 /js/tools/RectTool.js
parentb194664df7e01aaeb8d1e7220a6de0e7f879f1db (diff)
parent12de4e49a309e210c13eb40b2ffa158ef2eb54a7 (diff)
downloadninja-526b9d76686323f488f1b26175440172b715d808.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal
Diffstat (limited to 'js/tools/RectTool.js')
-rwxr-xr-xjs/tools/RectTool.js19
1 files changed, 13 insertions, 6 deletions
diff --git a/js/tools/RectTool.js b/js/tools/RectTool.js
index b35a101a..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));
@@ -117,12 +119,17 @@ exports.RectTool = Montage.create(ShapeTool, {
117 // TODO - update the shape's info only. shapeModel will likely need an array of shapes. 119 // TODO - update the shape's info only. shapeModel will likely need an array of shapes.
118 } 120 }
119 121
122 // TODO - This needs to be moved into geom obj's init routine instead of here
123 if(!fillM) {
124 this.setColor(canvas, this.options.fill, true, "rectTool");
125 }
126 if(!strokeM) {
127 this.setColor(canvas, this.options.stroke, false, "rectTool");
128 }
120 if(canvas.elementModel.isShape) 129 if(canvas.elementModel.isShape)
121 { 130 {
122 this.application.ninja.selectionController.selectElement(canvas); 131 this.application.ninja.selectionController.selectElement(canvas);
123 } 132 }
124
125
126 } 133 }
127 } 134 }
128}); \ No newline at end of file 135}); \ No newline at end of file