aboutsummaryrefslogtreecommitdiff
path: root/js/panels
diff options
context:
space:
mode:
authorValerio Virgillito2012-02-02 15:12:03 -0800
committerValerio Virgillito2012-02-02 15:12:03 -0800
commit4c6ea2383650ae328ed1e69c5f9c7c6878c6f810 (patch)
tree1f4194554032bee6a87aadf15cb647398a98b437 /js/panels
parent7303d3a7c3913658bf33be5f99db85a30889cfd9 (diff)
parentd41dee0c552a30724a146965ae4272a268777fc5 (diff)
downloadninja-4c6ea2383650ae328ed1e69c5f9c7c6878c6f810.tar.gz
Merge pull request #12 from mqg734/ToolFixes
Merged pan and zoom tool and 3d stage orientation fixes. Also updated PI to support shapes properties.
Diffstat (limited to 'js/panels')
-rw-r--r--js/panels/properties/content.reel/content.js7
-rw-r--r--js/panels/properties/sections/three-d-view.reel/three-d-view.html12
-rw-r--r--js/panels/properties/sections/three-d-view.reel/three-d-view.js86
3 files changed, 75 insertions, 30 deletions
diff --git a/js/panels/properties/content.reel/content.js b/js/panels/properties/content.reel/content.js
index fe6faef8..3cedee6d 100644
--- a/js/panels/properties/content.reel/content.js
+++ b/js/panels/properties/content.reel/content.js
@@ -182,8 +182,11 @@ exports.Content = Montage.create(Component, {
182 182
183 if(control.prop !== "border-color" && control.prop !== "background-color") { 183 if(control.prop !== "border-color" && control.prop !== "background-color") {
184 var currentValue = ElementsMediator.getProperty(el, control.prop, control.valueMutator); 184 var currentValue = ElementsMediator.getProperty(el, control.prop, control.valueMutator);
185 currentValue ? currentValue = currentValue : currentValue = control.defaultValue; 185 if(currentValue === null)
186 this.customSections[0].content.controls[control.id] = currentValue; 186 {
187 currentValue = control.defaultValue;
188 }
189 this.customSections[i].content.controls[control.id] = currentValue;
187 } 190 }
188 } 191 }
189 } 192 }
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 if(!this._curProp)
152 {
153 this._curProp = this.application.ninja.elementMediator.get3DProperty(item, prop);
154 }
155 delta -= this._curProp;
156 }
134 157
135 var xFormMat = Matrix.I(4); 158 var xFormMat = Matrix.I(4);
136 switch (prop) 159 switch (prop)
@@ -183,12 +206,31 @@ exports.ThreeD = Montage.create(Component, {
183 206
184 templateDidLoad : {