From fff3c568e6884a867527390b9b77f45c63944aec Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Tue, 20 Mar 2012 06:04:41 -0700 Subject: Removing zoom from element's getMatrix. Zoom should only be checked on stage. Signed-off-by: Nivesh Rajbhandari --- js/controllers/elements/element-controller.js | 16 ----------- js/controllers/elements/stage-controller.js | 41 +++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 16 deletions(-) (limited to 'js/controllers/elements') diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js index 70aba54e..b35251ad 100755 --- a/js/controllers/elements/element-controller.js +++ b/js/controllers/elements/element-controller.js @@ -228,22 +228,6 @@ var ElementController = exports.ElementController = Montage.create(NJComponent, mat = this.transformStringToMat( xformStr ); if (!mat) mat = Matrix.I(4); - - var zoom = this.application.ninja.elementMediator.getProperty(el, "zoom"); - if (zoom) - { - zoom = Number(zoom); - if (zoom != 1) - { - var zoomMat = Matrix.create( [ - [ zoom, 0, 0, 0], - [ 0, zoom, 0, 0], - [ 0, 0, zoom, 0], - [ 0, 0, 0, 1] - ] ); - glmat4.multiply( zoomMat, mat, mat ); - } - } } el.elementModel.props3D.matrix3d = mat; diff --git a/js/controllers/elements/stage-controller.js b/js/controllers/elements/stage-controller.js index 34bb1fb5..97ea3aa5 100755 --- a/js/controllers/elements/stage-controller.js +++ b/js/controllers/elements/stage-controller.js @@ -129,5 +129,46 @@ exports.StageController = Montage.create(ElementController, { value: function(el, rule, selector) { el.elementModel.transitionStopRule.selectorText = selector; } + }, + + getMatrix: { + value: function(el) { + if(el.elementModel && el.elementModel.props3D && el.elementModel.props3D.matrix3d) + { + return el.elementModel.props3D.matrix3d.slice(0); + } + else + { + var mat; + + if (el) + { + var xformStr = this.application.ninja.elementMediator.getProperty(el, "-webkit-transform"); + if (xformStr) + mat = this.transformStringToMat( xformStr ); + if (!mat) + mat = Matrix.I(4); + + var zoom = this.application.ninja.elementMediator.getProperty(el, "zoom"); + if (zoom) + { + zoom = Number(zoom); + if (zoom != 1) + { + var zoomMat = Matrix.create( [ + [ zoom, 0, 0, 0], + [ 0, zoom, 0, 0], + [ 0, 0, zoom, 0], + [ 0, 0, 0, 1] + ] ); + glmat4.multiply( zoomMat, mat, mat ); + } + } + } + + el.elementModel.props3D.matrix3d = mat; + return mat; + } + } } }); -- cgit v1.2.3 From e1c4f30a4c13d747fa69d78598e0961286bbe571 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Tue, 20 Mar 2012 10:59:05 -0700 Subject: Support button control in Properties Panel and use them for edit fill and stroke material. Signed-off-by: Nivesh Rajbhandari --- js/controllers/elements/shapes-controller.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'js/controllers/elements') diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js index d72d9c14..b3ac9ddb 100755 --- a/js/controllers/elements/shapes-controller.js +++ b/js/controllers/elements/shapes-controller.js @@ -6,10 +6,9 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot var Montage = require("montage/core/core").Montage, CanvasController = require("js/controllers/elements/canvas-controller").CanvasController, - njModule = require("js/lib/NJUtils"); - -var World = require("js/lib/drawing/world").World; -var MaterialsModel = require("js/models/materials-model").MaterialsModel; + njModule = require("js/lib/NJUtils"), + World = require("js/lib/drawing/world").World, + MaterialsModel = require("js/models/materials-model").MaterialsModel; exports.ShapesController = Montage.create(CanvasController, { @@ -100,6 +99,12 @@ exports.ShapesController = Montage.create(CanvasController, { el.elementModel.shapeModel.GLWorld.render(); } break; + case "editStrokeMaterial": + NJevent("showMaterialPopup",{materialId : el.elementModel.shapeModel.strokeMaterial.getName()}); + break; + case "editFillMaterial": + NJevent("showMaterialPopup",{materialId : el.elementModel.shapeModel.fillMaterial.getName()}); + break; default: CanvasController.setProperty(el, p, value); } -- cgit v1.2.3