aboutsummaryrefslogtreecommitdiff
path: root/js/controllers/elements
diff options
context:
space:
mode:
Diffstat (limited to 'js/controllers/elements')
-rw-r--r--js/controllers/elements/canvas-controller.js14
-rw-r--r--js/controllers/elements/element-controller.js61
-rw-r--r--js/controllers/elements/shapes-controller.js26
3 files changed, 63 insertions, 38 deletions
diff --git a/js/controllers/elements/canvas-controller.js b/js/controllers/elements/canvas-controller.js
index 21de9879..b5df3911 100644
--- a/js/controllers/elements/canvas-controller.js
+++ b/js/controllers/elements/canvas-controller.js
@@ -34,12 +34,12 @@ exports.CanvasController = Montage.create(ElementController, {
34 } 34 }
35 } 35 }
36 }, 36 },
37 37
38 setProperties: { 38 setProperties: {
39 value: function(el, props, index) { 39 value: function(el, props, index) {
40 for(var p in props) { 40 for(var p in props) {
41 el.elementModel.controller.setProperty(el, p, props[p][index]); 41 el.elementModel.controller.setProperty(el, p, props[p][index]);
42 } 42 }
43 } 43 }
44 } 44 }
45}); \ No newline at end of file 45}); \ No newline at end of file
diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js
index 9b13e703..65d26bdd 100644
--- a/js/controllers/elements/element-controller.js
+++ b/js/controllers/elements/element-controller.js
@@ -204,36 +204,35 @@ var ElementController = exports.ElementController = Montage.create(NJComponent,
204 } 204 }
205 else 205 else
206 { 206 {
207 // TODO - for now, just return the identity matrix 207 var mat;
208 return Matrix.I(4); 208
209// var mat; 209 if (el)
210// 210 {
211// if (elt) 211 var xformStr = this.application.ninja.elementMediator.getProperty(el, "-webkit-transform");
212// { 212 if (xformStr)
213// var xformStr = ElementsMediator.getProperty(elt, "-webkit-transform"); 213 mat = this.transformStringToMat( xformStr );
214// if (xformStr) 214 if (!mat)
215// mat = this.transformStringToMat( xformStr ); 215 mat = Matrix.I(4);
216// if (!mat) 216
217// mat = Matrix.I(4); 217 var zoom = this.application.ninja.elementMediator.getProperty(el, "zoom");
218// 218 if (zoom)
219// if (elt.style && elt.style.zoom) 219 {
220// { 220 zoom = Number(zoom);
221// var zoom = Number(elt.style.zoom); 221 if (zoom != 1)
222// if (zoom != 1) 222 {
223// { 223 var zoomMat = Matrix.create( [
224// var zoomMat = Matrix.create( [ 224 [ zoom, 0, 0, 0],
225// [ zoom, 0, 0, 0], 225 [ 0, zoom, 0, 0],
226// [ 0, zoom, 0, 0], 226 [ 0, 0, zoom, 0],
227// [ 0, 0, zoom, 0], 227 [ 0, 0, 0, 1]
228// [ 0, 0, 0, 1] 228 ] );
229// ] ); 229 glmat4.multiply( zoomMat, mat, mat );
230// glmat4.multiply( zoomMat, mat, mat ); 230 }
231// } 231 }
232// } 232 }
233// } 233
234// 234 el.elementModel.props3D.matrix3d = mat;
235// elt.elementModel.props3D.matrix3d = mat; 235 return mat;
236// return mat;
237 } 236 }
238 } 237 }
239 }, 238 },
@@ -284,7 +283,7 @@ var ElementController = exports.ElementController = Montage.create(NJComponent,
284 el.elementModel.props3D.matrix3d = mat; 283 el.elementModel.props3D.matrix3d = mat;
285 el.elementModel.props3D.perspectiveDist = dist; 284 el.elementModel.props3D.perspectiveDist = dist;
286 285
287// if(update3DModel) 286 if(update3DModel)
288 { 287 {
289 this._update3DProperties(el, mat, dist); 288 this._update3DProperties(el, mat, dist);
290 } 289 }
diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js
index 1717db94..5efbccd0 100644
--- a/js/controllers/elements/shapes-controller.js
+++ b/js/controllers/elements/shapes-controller.js
@@ -24,6 +24,26 @@ exports.ShapesController = Montage.create(CanvasController, {
24 el.elementModel.shapeModel.GLGeomObj.setInnerRadius(val/100); 24 el.elementModel.shapeModel.GLGeomObj.setInnerRadius(val/100);
25 el.elementModel.shapeModel.GLGeomObj.buildBuffers(); 25 el.elementModel.shapeModel.GLGeomObj.buildBuffers();
26 break; 26 break;
27 case "tlRadius":
28 this.setShapeProperty(el, "tlRadius", value);
29 el.elementModel.shapeModel.GLGeomObj.setTLRadius(val);
30 el.elementModel.shapeModel.GLGeomObj.buildBuffers();
31 break;
32 case "trRadius":
33 this.setShapeProperty(el, "trRadius", value);
34 el.elementModel.shapeModel.GLGeomObj.setTRRadius(val);
35 el.elementModel.shapeModel.GLGeomObj.buildBuffers();
36 break;
37 case "blRadius":
38 this.setShapeProperty(el, "blRadius", value);
39 el.elementModel.shapeModel.GLGeomObj.setBLRadius(val);
40 el.elementModel.shapeModel.GLGeomObj.buildBuffers();
41 break;
42 case "brRadius":
43 this.setShapeProperty(el, "brRadius", value);
44 el.elementModel.shapeModel.GLGeomObj.setBRRadius(val);
45 el.elementModel.shapeModel.GLGeomObj.buildBuffers();
46 break;
27 case "width": 47 case "width":
28 el.elementModel.shapeModel.GLGeomObj.setWidth(val); 48 el.elementModel.shapeModel.GLGeomObj.setWidth(val);
29 CanvasController.setProperty(el, p, value); 49 CanvasController.setProperty(el, p, value);
@@ -48,6 +68,12 @@ exports.ShapesController = Montage.create(CanvasController, {
48 switch(p) { 68 switch(p) {
49 case "strokeSize": 69 case "strokeSize":
50 case "innerRadius": 70 case "innerRadius":
71 case "tlRadius":
72 case "trRadius":
73 case "blRadius":
74 case "brRadius":
75 case "strokeMaterial":
76 case "fillMaterial":
51 case "border": 77 case "border":
52 case "background": 78 case "background":
53 return this.getShapeProperty(el, p); 79 return this.getShapeProperty(el, p);