aboutsummaryrefslogtreecommitdiff
path: root/js/tools/RectTool.js
diff options
context:
space:
mode:
authorKruti Shah2012-07-03 10:08:44 -0700
committerKruti Shah2012-07-03 10:08:44 -0700
commitbf5e6d6febf0c15a00e7694d7fa2c85b0cf567fe (patch)
tree006f6243962aa2e2b59f688cf37b16162376dc39 /js/tools/RectTool.js
parent3aa1242147264351b7d827fa25ecb5dc42bc2fb0 (diff)
parent12de4e49a309e210c13eb40b2ffa158ef2eb54a7 (diff)
downloadninja-bf5e6d6febf0c15a00e7694d7fa2c85b0cf567fe.tar.gz
Merge branch 'refs/heads/ninjainternalmaster' into Timeline-local-kruti
Conflicts: js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js Signed-off-by: Kruti Shah <kruti.shah@motorola.com>
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