aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rwxr-xr-xjs/mediators/element-mediator.js6
-rwxr-xr-xjs/panels/properties.reel/properties.js15
-rwxr-xr-xjs/tools/RotateStage3DTool.js5
3 files changed, 19 insertions, 7 deletions
diff --git a/js/mediators/element-mediator.js b/js/mediators/element-mediator.js
index eac0ca54..a2440fb4 100755
--- a/js/mediators/element-mediator.js
+++ b/js/mediators/element-mediator.js
@@ -673,17 +673,17 @@ exports.ElementMediator = Montage.create(NJComponent, {
673 }, 673 },
674 674
675 setMatrix: { 675 setMatrix: {
676 value: function(el, mat, isChanging) { 676 value: function(el, mat, isChanging, source) {
677 var dist = el.elementModel.controller["getPerspectiveDist"](el); 677 var dist = el.elementModel.controller["getPerspectiveDist"](el);
678 el.elementModel.controller["set3DProperties"](el, [{mat:mat, dist:dist}], 0, !isChanging); 678 el.elementModel.controller["set3DProperties"](el, [{mat:mat, dist:dist}], 0, !isChanging);
679 679
680 if(isChanging) 680 if(isChanging)
681 { 681 {
682 NJevent("elementChanging", {type : "setMatrix", source: null, data: {"els": [el], "prop": "matrix", "value": mat}, redraw: null}); 682 NJevent("elementChanging", {type : "setMatrix", source: source, data: {"els": [el], "prop": "matrix", "value": mat}, redraw: null});
683 } 683 }
684 else 684 else
685 { 685 {
686 NJevent("elementChange", {type : "setMatrix", source: null, data: {"els": [el], "prop": "matrix", "value": mat}, redraw: null}); 686 NJevent("elementChange", {type : "setMatrix", source: source, data: {"els": [el], "prop": "matrix", "value": mat}, redraw: null});
687 } 687 }
688 } 688 }
689 }, 689 },
diff --git a/js/panels/properties.reel/properties.js b/js/panels/properties.reel/properties.js
index 40e9b86a..782dd138 100755
--- a/js/panels/properties.reel/properties.js
+++ b/js/panels/properties.reel/properties.js
@@ -147,8 +147,12 @@ exports.Properties = Montage.create(Component, {
147 value: function(event) { 147 value: function(event) {
148// console.log("Element Change PI ", event.detail.source); // If the event comes from the pi don't need to update 148// console.log("Element Change PI ", event.detail.source); // If the event comes from the pi don't need to update
149 if(event.detail.source && event.detail.source !== "pi") { 149 if(event.detail.source && event.detail.source !== "pi") {
150 var el = this.application.ninja.currentDocument.documentRoot;
151 if(this.application.ninja.selectedElements.length) {
152 el = this.application.ninja.selectedElements[0]._element || this.application.ninja.selectedElements[0];
153 }
154
150 // TODO - This should only update the properties that were changed. 155 // TODO - This should only update the properties that were changed.
151 var el = this.application.ninja.selectedElements[0]._element || this.application.ninja.selectedElements[0];
152 this.positionSize.leftPosition = parseFloat(ElementsMediator.getProperty(el, "left")); 156 this.positionSize.leftPosition = parseFloat(ElementsMediator.getProperty(el, "left"));
153 this.positionSize.topPosition = parseFloat(ElementsMediator.getProperty(el, "top")); 157 this.positionSize.topPosition = parseFloat(ElementsMediator.getProperty(el, "top"));
154 this.positionSize.heightSize = parseFloat(ElementsMediator.getProperty(el, "height")); 158 this.positionSize.heightSize = parseFloat(ElementsMediator.getProperty(el, "height"));
@@ -162,9 +166,9 @@ exports.Properties = Montage.create(Component, {
162 this.threeD.xAngle = ElementsMediator.get3DProperty(el, "xAngle"); 166 this.threeD.xAngle = ElementsMediator.get3DProperty(el, "xAngle");
163 this.threeD.yAngle = ElementsMediator.get3DProperty(el, "yAngle"); 167 this.threeD.yAngle = ElementsMediator.get3DProperty(el, "yAngle");
164 this.threeD.zAngle = ElementsMediator.get3DProperty(el, "zAngle"); 168 this.threeD.zAngle = ElementsMediator.get3DProperty(el, "zAngle");
169 }
165 } 170 }
166 } 171 }
167 }
168 }, 172 },
169 173
170 handleSelectionChange: { 174 handleSelectionChange: {
@@ -196,6 +200,13 @@ exports.Properties = Montage.create(Component, {
196 this.positionSize.heightSize = parseFloat(ElementsMediator.getProperty(stage, "height")); 200 this.positionSize.heightSize = parseFloat(ElementsMediator.getProperty(stage, "height"));
197 this.positionSize.widthSize = parseFloat(ElementsMediator.getProperty(stage, "width")); 201 this.positionSize.widthSize = parseFloat(ElementsMediator.getProperty(stage, "width"));
198 202
203 if(this.threeD.inGlobalMode)
204 {
205 this.threeD.xAngle = ElementsMediator.get3DProperty(stage, "xAngle");
206 this.threeD.yAngle = ElementsMediator.get3DProperty(stage, "yAngle");
207 this.threeD.zAngle = ElementsMediator.get3DProperty(stage, "zAngle");
208 }
209
199 if(this.customPi !== stage.elementModel.pi) { 210 if(this.customPi !== stage.elementModel.pi) {
200 // We need to unregister color chips from the previous selection from the Color Model 211 // We need to unregister color chips from the previous selection from the Color Model
201 var len = this.customSections.length; 212 var len = this.customSections.length;
diff --git a/js/tools/RotateStage3DTool.js b/js/tools/RotateStage3DTool.js
index 2b312e53..f5cc4040 100755
--- a/js/tools/RotateStage3DTool.js
+++ b/js/tools/RotateStage3DTool.js
@@ -76,7 +76,7 @@ exports.RotateStage3DTool = Montage.create(Rotate3DToolBase, {
76 76
77 this._targets.push({elt:elt, mat:curMat, matInv:curMatInv, ctr:eltCtr}); 77 this._targets.push({elt:elt, mat:curMat, matInv:curMatInv, ctr:eltCtr});
78 78
79 viewUtils.setMatrixForElement( elt, curMat, false ); 79 ElementsMediator.setMatrix(elt, curMat, false, "rotateStage3DTool");
80 } 80 }
81 }, 81 },
82 82
@@ -130,7 +130,8 @@ exports.RotateStage3DTool = Montage.create(Rotate3DToolBase, {
130 // Reset stage to identity matrix 130 // Reset stage to identity matrix
131 var iMat = Matrix.I(4); 131 var iMat = Matrix.I(4);
132 132
133 ElementsMediator.setMatrix(this.application.ninja.currentDocument.documentRoot, iMat, false); 133 ElementsMediator.setMatrix(this.application.ninja.currentDocument.documentRoot,
134 iMat, false, "rotateStage3DTool");
134 this.application.ninja.currentDocument.documentRoot.elementModel.props3D.m_transformCtr = null; 135 this.application.ninja.currentDocument.documentRoot.elementModel.props3D.m_transformCtr = null;
135 136
136 // let the document and stage manager know about the zoom change 137 // let the document and stage manager know about the zoom change