aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/controllers/elements/element-controller.js59
-rw-r--r--js/mediators/element-mediator.js5
-rw-r--r--js/models/properties-3d.js4
3 files changed, 36 insertions, 32 deletions
diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js
index f254220c..30469db0 100644
--- a/js/controllers/elements/element-controller.js
+++ b/js/controllers/elements/element-controller.js
@@ -127,36 +127,35 @@ var ElementController = exports.ElementController = Montage.create(NJComponent,
127 } 127 }
128 else 128 else
129 { 129 {
130 // TODO - for now, just return the identity matrix 130 var mat;
131 return Matrix.I(4); 131
132// var mat; 132 if (el)
133// 133 {
134// if (elt) 134 var xformStr = this.application.ninja.elementMediator.getProperty(el, "-webkit-transform");
135// { 135 if (xformStr)
136// var xformStr = ElementsMediator.getProperty(elt, "-webkit-transform"); 136 mat = this.transformStringToMat( xformStr );
137// if (xformStr) 137 if (!mat)
138// mat = this.transformStringToMat( xformStr ); 138 mat = Matrix.I(4);
139// if (!mat) 139
140// mat = Matrix.I(4); 140 var zoom = this.application.ninja.elementMediator.getProperty(el, "zoom");
141// 141 if (zoom)
142// if (elt.style && elt.style.zoom) 142 {
143// { 143 zoom = Number(zoom);
144// var zoom = Number(elt.style.zoom); 144 if (zoom != 1)
145// if (zoom != 1) 145 {
146// { 146 var zoomMat = Matrix.create( [
147// var zoomMat = Matrix.create( [ 147 [ zoom, 0, 0, 0],
148// [ zoom, 0, 0, 0], 148 [ 0, zoom, 0, 0],
149// [ 0, zoom, 0, 0], 149 [ 0, 0, zoom, 0],
150// [ 0, 0, zoom, 0], 150 [ 0, 0, 0, 1]
151// [ 0, 0, 0, 1] 151 ] );
152// ] ); 152 glmat4.multiply( zoomMat, mat, mat );
153// glmat4.multiply( zoomMat, mat, mat ); 153 }
154// } 154 }
155// } 155 }
156// } 156
157// 157 el.elementModel.props3D.matrix3d = mat;
158// elt.elementModel.props3D.matrix3d = mat; 158 return mat;
159// return mat;
160 } 159 }
161 } 160 }
162 }, 161 },
diff --git a/js/mediators/element-mediator.js b/js/mediators/element-mediator.js
index 91b09475..a6f31703 100644
--- a/js/mediators/element-mediator.js
+++ b/js/mediators/element-mediator.js
@@ -92,6 +92,11 @@ exports.ElementMediator = Montage.create(NJComponent, {
92 _addElement: { 92 _addElement: {
93 value: function(el, rules, noEvent) { 93 value: function(el, rules, noEvent) {
94 ElementController.addElement(el, rules); 94 ElementController.addElement(el, rules);
95 var p3d = this.get3DProperties(el);
96 if(p3d)
97 {
98 el.elementModel.controller["set3DProperties"](el, [p3d], 0, true);
99 }
95 if(!noEvent) NJevent("elementAdded", el); 100 if(!noEvent) NJevent("elementAdded", el);
96 } 101 }
97 }, 102 },
diff --git a/js/models/properties-3d.js b/js/models/properties-3d.js
index 3c809f06..cf4a045f 100644
--- a/js/models/properties-3d.js
+++ b/js/models/properties-3d.js
@@ -22,7 +22,7 @@ exports.Properties3D = Montage.create(Component, {
22 _world : {value : null, enumerable:true}, // keep a referenceto the GLWorld (if any) 22 _world : {value : null, enumerable:true}, // keep a referenceto the GLWorld (if any)
23 23
24 // Keep track of 3d properties 24 // Keep track of 3d properties
25 matrix3d : {value : [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1], enumerable: true}, 25 matrix3d : {value : null, enumerable: true},
26 26
27 xAngle : {value : 0, enumerable: true}, 27 xAngle : {value : 0, enumerable: true},
28 yAngle : {value : 0, enumerable: true}, 28 yAngle : {value : 0, enumerable: true},
@@ -33,7 +33,7 @@ exports.Properties3D = Montage.create(Component, {
33 z3D : {value : 0, enumerable: true}, 33 z3D : {value : 0, enumerable: true},
34 34
35 //TODO - not sure if this should be part of the tool or stage or a utility 35 //TODO - not sure if this should be part of the tool or stage or a utility
36 perspectiveDist : { value : 1400, enumerable: true}, 36 perspectiveDist : { value : null, enumerable: true},
37 perspectiveMode : { value : null, enumerable: true}, 37 perspectiveMode : { value : null, enumerable: true},
38 38
39 elementPlane : { value : null, enumerable: true}, 39 elementPlane : { value : null, enumerable: true},