aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-04-05 16:43:25 -0700
committerNivesh Rajbhandari2012-04-05 16:43:25 -0700
commitd42af4f0f5e893ab0e1f74f50055e0be3bd9e78e (patch)
tree4ed889d0d09d8f29c55380c4216d9523c41b2d0a
parent8122876daad3e5a03b33f522751f3aca354615ca (diff)
downloadninja-d42af4f0f5e893ab0e1f74f50055e0be3bd9e78e.tar.gz
-webkit-transform-style needs to be set to preserve-3d for shapes regardless of whether they are 2d shapes or WebGL shapes.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
-rwxr-xr-xjs/controllers/elements/shapes-controller.js1
-rw-r--r--js/tools/BrushTool.js2
-rwxr-xr-xjs/tools/LineTool.js2
-rwxr-xr-xjs/tools/PenTool.js2
-rwxr-xr-xjs/tools/ShapeTool.js2
-rwxr-xr-xjs/tools/TagTool.js4
6 files changed, 6 insertions, 7 deletions
diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js
index 514b1472..51ddea20 100755
--- a/js/controllers/elements/shapes-controller.js
+++ b/js/controllers/elements/shapes-controller.js
@@ -629,7 +629,6 @@ exports.ShapesController = Montage.create(CanvasController, {
629 world = new World(el, true); 629 world = new World(el, true);
630 el.elementModel.shapeModel.GLWorld = world; 630 el.elementModel.shapeModel.GLWorld = world;
631 el.elementModel.shapeModel.useWebGl = true; 631 el.elementModel.shapeModel.useWebGl = true;
632 el.elementModel.controller.setProperty(el, "-webkit-transform-style", "preserve-3d");
633 world.importJSON(worldData); 632 world.importJSON(worldData);
634 el.elementModel.shapeModel.GLGeomObj = world.getGeomRoot(); 633 el.elementModel.shapeModel.GLGeomObj = world.getGeomRoot();
635 } 634 }
diff --git a/js/tools/BrushTool.js b/js/tools/BrushTool.js
index 1365896a..4347658a 100644
--- a/js/tools/BrushTool.js
+++ b/js/tools/BrushTool.js
@@ -305,7 +305,7 @@ exports.BrushTool = Montage.create(ShapeTool, {
305 305
306 if (!canvas) { 306 if (!canvas) {
307 var newCanvas = NJUtils.makeNJElement("canvas", "Brushstroke", "shape", {"data-RDGE-id": NJUtils.generateRandom()}, true); 307 var newCanvas = NJUtils.makeNJElement("canvas", "Brushstroke", "shape", {"data-RDGE-id": NJUtils.generateRandom()}, true);
308 var elementModel = TagTool.makeElement(w, h, planeMat, midPt, newCanvas, this._useWebGL); 308 var elementModel = TagTool.makeElement(w, h, planeMat, midPt, newCanvas, true);
309 ElementMediator.addElements(newCanvas, elementModel.data, false); 309 ElementMediator.addElements(newCanvas, elementModel.data, false);
310 310
311 // create all the GL stuff 311 // create all the GL stuff
diff --git a/js/tools/LineTool.js b/js/tools/LineTool.js
index de2eb21d..3e9167fd 100755
--- a/js/tools/LineTool.js
+++ b/js/tools/LineTool.js
@@ -78,7 +78,7 @@ exports.LineTool = Montage.create(ShapeTool, {
78 } 78 }
79 79
80 canvas = NJUtils.makeNJElement("canvas", "Canvas", "shape", {"data-RDGE-id": NJUtils.generateRandom()}, true); 80 canvas = NJUtils.makeNJElement("canvas", "Canvas", "shape", {"data-RDGE-id": NJUtils.generateRandom()}, true);
81 var elementModel = TagTool.makeElement(w, h, drawData.planeMat, drawData.midPt, canvas, this.options.use3D); 81 var elementModel = TagTool.makeElement(w, h, drawData.planeMat, drawData.midPt, canvas, true);
82 canvas.elementModel.isShape = true; 82 canvas.elementModel.isShape = true;
83 this.application.ninja.elementMediator.addElements(canvas, elementModel.data); 83 this.application.ninja.elementMediator.addElements(canvas, elementModel.data);
84 } else { 84 } else {
diff --git a/js/tools/PenTool.js b/js/tools/PenTool.js
index 7f6f190a..7fc8dd95 100755
--- a/js/tools/PenTool.js
+++ b/js/tools/PenTool.js
@@ -584,7 +584,7 @@ exports.PenTool = Montage.create(ShapeTool, {
584 if (!canvas) { 584 if (!canvas) {
585 var newCanvas = null; 585 var newCanvas = null;
586 newCanvas = NJUtils.makeNJElement("canvas", "Subpath", "shape", {"data-RDGE-id": NJUtils.generateRandom()}, true); 586 newCanvas = NJUtils.makeNJElement("canvas", "Subpath", "shape", {"data-RDGE-id": NJUtils.generateRandom()}, true);
587 var elementModel = TagTool.makeElement(parseInt(w), parseInt(h), planeMat, midPt, newCanvas, this._useWebGL); 587 var elementModel = TagTool.makeElement(parseInt(w), parseInt(h), planeMat, midPt, newCanvas, true);
588 ElementMediator.addElements(newCanvas, elementModel.data, false); 588 ElementMediator.addElements(newCanvas, elementModel.data, false);
589 589
590 // create all the GL stuff 590 // create all the GL stuff
diff --git a/js/tools/ShapeTool.js b/js/tools/ShapeTool.js
index 00d36528..a8da7921 100755
--- a/js/tools/ShapeTool.js
+++ b/js/tools/ShapeTool.js
@@ -66,7 +66,7 @@ exports.ShapeTool = Montage.create(DrawingTool, {
66 if(!this._useExistingCanvas()) { 66 if(!this._useExistingCanvas()) {
67 canvas = NJUtils.makeNJElement("canvas", "Canvas", "shape", {"data-RDGE-id": NJUtils.generateRandom()}, true); 67 canvas = NJUtils.makeNJElement("canvas", "Canvas", "shape", {"data-RDGE-id": NJUtils.generateRandom()}, true);
68 var elementModel = TagTool.makeElement(~~drawData.width, ~~drawData.height, 68 var elementModel = TagTool.makeElement(~~drawData.width, ~~drawData.height,
69 drawData.planeMat, drawData.midPt, canvas, this.options.use3D); 69 drawData.planeMat, drawData.midPt, canvas, true);
70 70
71 canvas.elementModel.isShape = true; 71 canvas.elementModel.isShape = true;
72 this.application.ninja.elementMediator.addElements(canvas, elementModel.data); 72 this.application.ninja.elementMediator.addElements(canvas, elementModel.data);
diff --git a/js/tools/TagTool.js b/js/tools/TagTool.js
index f4b65c3e..752500e0 100755
--- a/js/tools/TagTool.js
+++ b/js/tools/TagTool.js
@@ -221,7 +221,7 @@ exports.TagTool = Montage.create(DrawingTool, {
221 }, 221 },
222 222
223 makeElement: { 223 makeElement: {
224 value: function(w, h, planeMat, midPt,tag, isWebGl) { 224 value: function(w, h, planeMat, midPt, tag, isShape) {
225 var left = Math.round(midPt[0] - 0.5 * w); 225 var left = Math.round(midPt[0] - 0.5 * w);
226 var top = Math.round(midPt[1] - 0.5 * h); 226 var top = Math.round(midPt[1] - 0.5 * h);
227 227
@@ -234,7 +234,7 @@ exports.TagTool = Montage.create(DrawingTool, {
234 if(!MathUtils.isIdentityMatrix(planeMat)) { 234 if(!MathUtils.isIdentityMatrix(planeMat)) {
235 styles['-webkit-transform-style'] = 'preserve-3d'; 235 styles['-webkit-transform-style'] = 'preserve-3d';
236 styles['-webkit-transform'] = DrawingToolBase.getElementMatrix(planeMat, midPt); 236 styles['-webkit-transform'] = DrawingToolBase.getElementMatrix(planeMat, midPt);
237 } else if(isWebGl) { 237 } else if(isShape) {
238 styles['-webkit-transform-style'] = 'preserve-3d'; 238 styles['-webkit-transform-style'] = 'preserve-3d';
239 } 239 }
240 240