aboutsummaryrefslogtreecommitdiff
path: root/js/controllers/elements
diff options
context:
space:
mode:
authorValerio Virgillito2012-06-07 10:51:26 -0700
committerValerio Virgillito2012-06-07 10:51:26 -0700
commitb75fe9369f7caec0351d298f7106c8d59572b440 (patch)
tree8f2f2db6097104e44c8d87e11466d1f3124c7f3a /js/controllers/elements
parent47e0e1f047e83b71c3f86812a45d33904201cc7a (diff)
parent6442dcc0cc4088d28558a9c121c6a91cba3ff078 (diff)
downloadninja-b75fe9369f7caec0351d298f7106c8d59572b440.tar.gz
Merge pull request #275 from mencio/element-model-fixes
Element model fixes and selection fixes
Diffstat (limited to 'js/controllers/elements')
-rwxr-xr-xjs/controllers/elements/body-controller.js4
-rwxr-xr-xjs/controllers/elements/element-controller.js8
-rwxr-xr-xjs/controllers/elements/shapes-controller.js2
3 files changed, 7 insertions, 7 deletions
diff --git a/js/controllers/elements/body-controller.js b/js/controllers/elements/body-controller.js
index 7a3a66f5..9c427c62 100755
--- a/js/controllers/elements/body-controller.js
+++ b/js/controllers/elements/body-controller.js
@@ -71,7 +71,7 @@ exports.BodyController = Montage.create(ElementController, {
71 71
72 getPerspectiveDist: { 72 getPerspectiveDist: {
73 value: function(el) { 73 value: function(el) {
74 if(el.elementModel && el.elementModel.props3D && el.elementModel.props3D.perspectiveDist) { 74 if(el.elementModel.props3D && el.elementModel.props3D.perspectiveDist) {
75 return el.elementModel.props3D.perspectiveDist; 75 return el.elementModel.props3D.perspectiveDist;
76 } else { 76 } else {
77 var dist = this.application.ninja.stylesController.getPerspectiveDistFromElement(el, true); 77 var dist = this.application.ninja.stylesController.getPerspectiveDistFromElement(el, true);
@@ -83,7 +83,7 @@ exports.BodyController = Montage.create(ElementController, {
83 83
84 getMatrix: { 84 getMatrix: {
85 value: function(el) { 85 value: function(el) {
86 if(el.elementModel && el.elementModel.props3D && el.elementModel.props3D.matrix3d) 86 if(el.elementModel.props3D && el.elementModel.props3D.matrix3d)
87 { 87 {
88 return el.elementModel.props3D.matrix3d.slice(0); 88 return el.elementModel.props3D.matrix3d.slice(0);
89 } 89 }
diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js
index 941e05ba..4a02e9a3 100755
--- a/js/controllers/elements/element-controller.js
+++ b/js/controllers/elements/element-controller.js
@@ -37,7 +37,7 @@ exports.ElementController = Montage.create(Component, {
37 // Remove the element from the DOM and clear the GLWord. 37 // Remove the element from the DOM and clear the GLWord.
38 removeElement: { 38 removeElement: {
39 value: function(el) { 39 value: function(el) {
40 if(el.elementModel && el.elementModel.shapeModel && el.elementModel.shapeModel.GLWorld) { 40 if(el.elementModel.shapeModel && el.elementModel.shapeModel.GLWorld) {
41 el.elementModel.shapeModel.GLWorld.clearTree(); 41 el.elementModel.shapeModel.GLWorld.clearTree();
42 } 42 }
43 el.parentNode.removeChild(el); 43 el.parentNode.removeChild(el);
@@ -277,7 +277,7 @@ exports.ElementController = Montage.create(Component, {
277 // Routines to get/set 3D properties 277 // Routines to get/set 3D properties
278 get3DProperty: { 278 get3DProperty: {
279 value: function(el, prop) { 279 value: function(el, prop) {
280 if(el.elementModel && el.elementModel.props3D) { 280 if(el.elementModel.props3D) {
281 return el.elementModel.props3D[prop]; 281 return el.elementModel.props3D[prop];
282 } 282 }
283 } 283 }
@@ -285,7 +285,7 @@ exports.ElementController = Montage.create(Component, {
285 285
286 getMatrix: { 286 getMatrix: {
287 value: function(el) { 287 value: function(el) {
288 if(el.elementModel && el.elementModel.props3D && el.elementModel.props3D.matrix3d) { 288 if(el.elementModel.props3D && el.elementModel.props3D.matrix3d) {
289 return el.elementModel.props3D.matrix3d.slice(0); 289 return el.elementModel.props3D.matrix3d.slice(0);
290 } else { 290 } else {
291 var mat; 291 var mat;
@@ -305,7 +305,7 @@ exports.ElementController = Montage.create(Component, {
305 305
306 getPerspectiveDist: { 306 getPerspectiveDist: {
307 value: function(el) { 307 value: function(el) {
308 if(el.elementModel && el.elementModel.props3D && el.elementModel.props3D.perspectiveDist) { 308 if(el.elementModel.props3D && el.elementModel.props3D.perspectiveDist) {
309 return el.elementModel.props3D.perspectiveDist; 309 return el.elementModel.props3D.perspectiveDist;
310 } else { 310 } else {
311 var dist = this.application.ninja.stylesController.getPerspectiveDistFromElement(el, false); 311 var dist = this.application.ninja.stylesController.getPerspectiveDistFromElement(el, false);
diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js
index 845e7dc2..9fc9b576 100755
--- a/js/controllers/elements/shapes-controller.js
+++ b/js/controllers/elements/shapes-controller.js
@@ -133,7 +133,7 @@ exports.ShapesController = Montage.create(CanvasController, {
133 canvas.setAttribute("data-RDGE-id", njModule.NJUtils.generateRandom()); 133 canvas.setAttribute("data-RDGE-id", njModule.NJUtils.generateRandom());
134 canvas.width = el.width; 134 canvas.width = el.width;
135 canvas.height = el.height; 135 canvas.height = el.height;
136 canvas.elementModel = el.elementModel; 136 canvas._model = el.elementModel;
137 this.toggleWebGlMode(canvas, value); 137 this.toggleWebGlMode(canvas, value);
138 this.application.ninja.elementMediator.replaceElement(canvas, el); 138 this.application.ninja.elementMediator.replaceElement(canvas, el);
139 break; 139 break;