diff options
Diffstat (limited to 'js/panels/properties')
3 files changed, 86 insertions, 30 deletions
diff --git a/js/panels/properties/content.reel/content.js b/js/panels/properties/content.reel/content.js index 6cb66071..20dc308f 100644 --- a/js/panels/properties/content.reel/content.js +++ b/js/panels/properties/content.reel/content.js | |||
@@ -97,10 +97,24 @@ exports.Content = Montage.create(Component, { | |||
97 | value: function(event) { | 97 | value: function(event) { |
98 | // console.log("Element Change PI ", event.detail.source); // If the event comes from the pi don't need to update | 98 | // console.log("Element Change PI ", event.detail.source); // If the event comes from the pi don't need to update |
99 | if(event.detail.source && event.detail.source !== "pi") { | 99 | if(event.detail.source && event.detail.source !== "pi") { |
100 | this.positionSize.leftPosition = parseFloat(ElementsMediator.getProperty(this.application.ninja.selectedElements[0]._element, "left")); | 100 | // TODO - This should only update the properties that were changed. |
101 | this.positionSize.topPosition = parseFloat(ElementsMediator.getProperty(this.application.ninja.selectedElements[0]._element, "top")); | 101 | var el = this.application.ninja.selectedElements[0]._element || this.application.ninja.selectedElements[0]; |
102 | this.positionSize.leftPosition = parseFloat(ElementsMediator.getProperty(el, "left")); | ||
103 | this.positionSize.topPosition = parseFloat(ElementsMediator.getProperty(el, "top")); | ||
104 | this.positionSize.heightSize = parseFloat(ElementsMediator.getProperty(el, "height")); | ||
105 | this.positionSize.widthSize = parseFloat(ElementsMediator.getProperty(el, "width")); | ||
106 | |||
107 | if(this.threeD.inGlobalMode) | ||
108 | { | ||
109 | this.threeD.x3D = ElementsMediator.get3DProperty(el, "x3D"); | ||
110 | this.threeD.y3D = ElementsMediator.get3DProperty(el, "y3D"); | ||
111 | this.threeD.z3D = ElementsMediator.get3DProperty(el, "z3D"); | ||
112 | this.threeD.xAngle = ElementsMediator.get3DProperty(el, "xAngle"); | ||
113 | this.threeD.yAngle = ElementsMediator.get3DProperty(el, "yAngle"); | ||
114 | this.threeD.zAngle = ElementsMediator.get3DProperty(el, "zAngle"); | ||
102 | } | 115 | } |
103 | } | 116 | } |
117 | } | ||
104 | }, | 118 | }, |
105 | 119 | ||
106 | handleSelectionChange: { | 120 | handleSelectionChange: { |
diff --git a/js/panels/properties/sections/three-d-view.reel/three-d-view.html b/js/panels/properties/sections/three-d-view.reel/three-d-view.html index 1e24cb55..11a5b3f2 100644 --- a/js/panels/properties/sections/three-d-view.reel/three-d-view.html +++ b/js/panels/properties/sections/three-d-view.reel/three-d-view.html | |||
@@ -39,7 +39,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot | |||
39 | "value": { | 39 | "value": { |
40 | "boundObject": {"@": "owner"}, | 40 | "boundObject": {"@": "owner"}, |
41 | "boundObjectPropertyPath": "x3D", | 41 | "boundObjectPropertyPath": "x3D", |
42 | "oneway": false | 42 | "oneway": true |
43 | } | 43 | } |
44 | }, | 44 | }, |
45 | "listeners": [ | 45 | "listeners": [ |
@@ -68,7 +68,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot | |||
68 | "value": { | 68 | "value": { |
69 | "boundObject": {"@": "owner"}, | 69 | "boundObject": {"@": "owner"}, |
70 | "boundObjectPropertyPath": "y3D", | 70 | "boundObjectPropertyPath": "y3D", |
71 | "oneway": false | 71 | "oneway": true |
72 | } | 72 | } |
73 | }, | 73 | }, |
74 | "listeners": [ | 74 | "listeners": [ |
@@ -97,7 +97,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot | |||
97 | "value": { | 97 | "value": { |
98 | "boundObject": {"@": "owner"}, | 98 | "boundObject": {"@": "owner"}, |
99 | "boundObjectPropertyPath": "z3D", | 99 | "boundObjectPropertyPath": "z3D", |
100 | "oneway": false | 100 | "oneway": true |
101 | } | 101 | } |
102 | }, | 102 | }, |
103 | "listeners": [ | 103 | "listeners": [ |
@@ -128,7 +128,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot | |||
128 | "value": { | 128 | "value": { |
129 | "boundObject": {"@": "owner"}, | 129 | "boundObject": {"@": "owner"}, |
130 | "boundObjectPropertyPath": "xAngle", | 130 | "boundObjectPropertyPath": "xAngle", |
131 | "oneway": false | 131 | "oneway": true |
132 | } | 132 | } |
133 | }, | 133 | }, |
134 | "listeners": [ | 134 | "listeners": [ |
@@ -159,7 +159,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot | |||
159 | "value": { | 159 | "value": { |
160 | "boundObject": {"@": "owner"}, | 160 | "boundObject": {"@": "owner"}, |
161 | "boundObjectPropertyPath": "yAngle", | 161 | "boundObjectPropertyPath": "yAngle", |
162 | "oneway": false | 162 | "oneway": true |
163 | } | 163 | } |
164 | }, | 164 | }, |
165 | "listeners": [ | 165 | "listeners": [ |
@@ -190,7 +190,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot | |||
190 | "value": { | 190 | "value": { |
191 | "boundObject": {"@": "owner"}, | 191 | "boundObject": {"@": "owner"}, |
192 | "boundObjectPropertyPath": "zAngle", | 192 | "boundObjectPropertyPath": "zAngle", |
193 | "oneway": false | 193 | "oneway": true |
194 | } | 194 | } |
195 | }, | 195 | }, |
196 | "listeners": [ | 196 | "listeners": [ |
diff --git a/js/panels/properties/sections/three-d-view.reel/three-d-view.js b/js/panels/properties/sections/three-d-view.reel/three-d-view.js index 38dbb110..96053490 100644 --- a/js/panels/properties/sections/three-d-view.reel/three-d-view.js +++ b/js/panels/properties/sections/three-d-view.reel/three-d-view.js | |||
@@ -40,19 +40,16 @@ exports.ThreeD = Montage.create(Component, { | |||
40 | else | 40 | else |
41 | { | 41 | { |
42 | this.inGlobalMode = true; | 42 | this.inGlobalMode = true; |
43 | if(this.application.ninja.selectedElements.length) | 43 | var item = this.item; |
44 | if(item) | ||
44 | { | 45 | { |
45 | var item = this.application.ninja.selectedElements[0]._element; | 46 | this.x3D = item.elementModel.props3D.x3D; |
46 | if(item) | 47 | this.y3D = item.elementModel.props3D.y3D; |
47 | { | 48 | this.z3D = item.elementModel.props3D.z3D; |
48 | this.x3D = item.elementModel.props3D.x3D; | 49 | |
49 | this.y3D = item.elementModel.props3D.y3D; | 50 | this.xAngle = item.elementModel.props3D.xAngle; |
50 | this.z3D = item.elementModel.props3D.z3D; | 51 | this.yAngle = item.elementModel.props3D.yAngle; |
51 | 52 | this.zAngle = item.elementModel.props3D.zAngle; | |
52 | this.xAngle = item.elementModel.props3D.xAngle; | ||
53 | this.yAngle = item.elementModel.props3D.yAngle; | ||
54 | this.zAngle = item.elementModel.props3D.zAngle; | ||
55 | } | ||
56 | } | 53 | } |
57 | } | 54 | } |
58 | } | 55 | } |
@@ -98,6 +95,18 @@ exports.ThreeD = Montage.create(Component, { | |||
98 | } | 95 | } |
99 | }, | 96 | }, |
100 | 97 | ||
98 | item: { | ||
99 | value: null | ||
100 | }, | ||
101 | |||
102 | _curMat: { | ||
103 | value: null | ||
104 | }, | ||
105 | |||
106 | _curProp: { | ||
107 | value: null | ||
108 | }, | ||
109 | |||
101 | handleChange: { | 110 | handleChange: { |
102 | value: function(event) { | 111 | value: function(event) { |
103 | if(event.wasSetByCode) { | 112 | if(event.wasSetByCode) { |
@@ -106,9 +115,12 @@ exports.ThreeD = Montage.create(Component, { | |||
106 | 115 | ||
107 | this.apply3DProperties(event.currentTarget.identifier, | 116 | this.apply3DProperties(event.currentTarget.identifier, |
108 | event.currentTarget, | 117 | event.currentTarget, |
109 | this.application.ninja.selectedElements[0]._element, | 118 | this.item, |
110 | this.inGlobalMode, | 119 | this.inGlobalMode, |
111 | false); | 120 | false); |
121 | |||
122 | this._curMat = null; | ||
123 | this._curProp = null; | ||
112 | } | 124 | } |
113 | }, | 125 | }, |
114 | 126 | ||
@@ -120,7 +132,7 @@ exports.ThreeD = Montage.create(Component, { | |||
120 | 132 | ||
121 | this.apply3DProperties(event.currentTarget.identifier, | 133 | this.apply3DProperties(event.currentTarget.identifier, |
122 | event.currentTarget, | 134 | event.currentTarget, |
123 | this.application.ninja.selectedElements[0]._element, | 135 | this.item, |
124 | this.inGlobalMode, | 136 | this.inGlobalMode, |
125 | true); | 137 | true); |
126 | } | 138 | } |
@@ -128,9 +140,20 @@ exports.ThreeD = Montage.create(Component, { | |||
128 | 140 | ||
129 | apply3DProperties : { | 141 | apply3DProperties : { |
130 | value : function(prop, value, item, inGlobalMode, isChanging){ | 142 | value : function(prop, value, item, inGlobalMode, isChanging){ |
131 | // TODO - May want to use mediator instead | 143 | if(!this._curMat) |
132 | var curMat = item.elementModel.props3D.matrix3d; | 144 | { |
133 | var delta = value.value - item.elementModel.props3D[prop]; | 145 | this._curMat = this.application.ninja.elementMediator.getMatrix(item); |
146 | } | ||
147 | var curMat = this._curMat; | ||
148 | var delta = value.value; | ||
149 | if(inGlobalMode) | ||
150 | { | ||
151 |