aboutsummaryrefslogtreecommitdiff
path: root/js/tools/OvalTool.js
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-02-29 16:45:40 -0800
committerNivesh Rajbhandari2012-02-29 16:45:40 -0800
commitf04cc0146d8f7573628678613a99c270116768e4 (patch)
treec8dee41bc60b5f1c4560f3a71514538b35905fe5 /js/tools/OvalTool.js
parentb09956e4a9a35c5588cc7cd1f01efb617cbe0884 (diff)
downloadninja-f04cc0146d8f7573628678613a99c270116768e4.tar.gz
Last-used material (instead of FlatMaterial) is applied to shape when turning on use WebGL checkbox in the PI.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js/tools/OvalTool.js')
-rwxr-xr-xjs/tools/OvalTool.js20
1 files changed, 11 insertions, 9 deletions
diff --git a/js/tools/OvalTool.js b/js/tools/OvalTool.js
index 14655312..911059a7 100755
--- a/js/tools/OvalTool.js
+++ b/js/tools/OvalTool.js
@@ -43,19 +43,21 @@ exports.OvalTool = Montage.create(ShapeTool, {
43 var strokeMaterial = null; 43 var strokeMaterial = null;
44 var fillMaterial = null; 44 var fillMaterial = null;
45 45
46 var strokeM = this.options.strokeMaterial; 46 if(this.options.use3D)
47 if(strokeM)
48 { 47 {
49 strokeMaterial = Object.create(MaterialsLibrary.getMaterial(strokeM)); 48 var strokeM = this.options.strokeMaterial;
50 } 49 if(strokeM)
50 {
51 strokeMaterial = Object.create(MaterialsLibrary.getMaterial(strokeM));
52 }
51 53
52 var fillM = this.options.fillMaterial; 54 var fillM = this.options.fillMaterial;
53 if(fillM) 55 if(fillM)
54 { 56 {
55 fillMaterial = Object.create(MaterialsLibrary.getMaterial(fillM)); 57 fillMaterial = Object.create(MaterialsLibrary.getMaterial(fillM));
58 }
56 } 59 }
57 60
58
59 var world = this.getGLWorld(canvas, this.options.use3D); 61 var world = this.getGLWorld(canvas, this.options.use3D);
60 62
61 var xOffset = ((left - canvas.offsetLeft + w/2) - canvas.width/2); 63 var xOffset = ((left - canvas.offsetLeft + w/2) - canvas.width/2);