aboutsummaryrefslogtreecommitdiff
path: root/js/controllers
diff options
context:
space:
mode:
authorValerio Virgillito2012-03-30 14:27:23 -0700
committerValerio Virgillito2012-03-30 14:27:23 -0700
commit21ef6d98059209f171626336247a4e2fd92101e4 (patch)
treefb3799ebacf570b7eedad7c3b5a2c57b64665886 /js/controllers
parent7542f62ee7a4845c2472834d0dbe91bf669634da (diff)
parentf4949cab544886702e7ad6eeaa6215125c7b067a (diff)
downloadninja-21ef6d98059209f171626336247a4e2fd92101e4.tar.gz
Merge branch 'refs/heads/master' into components
Diffstat (limited to 'js/controllers')
-rwxr-xr-xjs/controllers/elements/shapes-controller.js62
1 files changed, 62 insertions, 0 deletions
diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js
index f0e9458b..ef453bea 100755
--- a/js/controllers/elements/shapes-controller.js
+++ b/js/controllers/elements/shapes-controller.js
@@ -119,6 +119,31 @@ exports.ShapesController = Montage.create(CanvasController, {
119 el.elementModel.shapeModel.GLWorld._canvas.task.stop(); 119 el.elementModel.shapeModel.GLWorld._canvas.task.stop();
120 } 120 }
121 break; 121 break;
122 case "strokeHardness":
123 this.setShapeProperty(el, "strokeHardness", value);
124 el.elementModel.shapeModel.GLGeomObj.setStrokeHardness(val);
125 el.elementModel.shapeModel.GLWorld.render();
126 break;
127 case "strokeSmoothing":
128 this.setShapeProperty(el, "strokeSmoothing", value);
129 el.elementModel.shapeModel.GLGeomObj.setSmoothingAmount(val);
130 el.elementModel.shapeModel.GLWorld.render();
131 break;
132 case "doSmoothing":
133 this.setShapeProperty(el, "doSmoothing", value);
134 el.elementModel.shapeModel.GLGeomObj.setDoSmoothing(value);
135 el.elementModel.shapeModel.GLWorld.render();
136 break;
137 case "isCalligraphic":
138 this.setShapeProperty(el, "isCalligraphic", value);
139 el.elementModel.shapeModel.GLGeomObj.setStrokeUseCalligraphic(value);
140 el.elementModel.shapeModel.GLWorld.render();
141 break;
142 case "strokeAngle":
143 this.setShapeProperty(el, "strokeAngle", value);
144 el.elementModel.shapeModel.GLGeomObj.setStrokeAngle(Math.PI * val/180);
145 el.elementModel.shapeModel.GLWorld.render();
146 break;
122 default: 147 default:
123 CanvasController.setProperty(el, p, value); 148 CanvasController.setProperty(el, p, value);
124 } 149 }
@@ -139,6 +164,43 @@ exports.ShapesController = Montage.create(CanvasController, {
139 case "useWebGl": 164 case "useWebGl":
140 case "animate": 165 case "animate":
141 return this.getShapeProperty(el, p); 166 return this.getShapeProperty(el, p);
167 case "strokeHardness":
168 if (el.elementModel && el.elementModel.shapeModel){
169 return el.elementModel.shapeModel.GLGeomObj.getStrokeHardness();
170 } else {
171 return null;
172 }
173 break;
174 case "doSmoothing":
175 if (el.elementModel && el.elementModel.shapeModel){
176 return el.elementModel.shapeModel.GLGeomObj.getDoSmoothing();
177 } else {
178 return null;
179 }
180 break;
181 case "strokeSmoothing":
182 if (el.elementModel && el.elementModel.shapeModel){
183 return el.elementModel.shapeModel.GLGeomObj.getSmoothingAmount();
184 } else {
185 return null;
186 }
187 break;
188 case "isCalligraphic":
189 if (el.elementModel && el.elementModel.shapeModel){
190 return el.elementModel.shapeModel.GLGeomObj.getStrokeUseCalligraphic();
191 } else {
192 return null;
193 }
194 break;
195 case "strokeAngle":
196 if (el.elementModel && el.elementModel.shapeModel){
197 return 180*el.elementModel.shapeModel.GLGeomObj.getStrokeAngle()/Math.PI;
198 } else {
199 return null;
200 }
201 break;
202
203
142 case "strokeMaterial": 204 case "strokeMaterial":
143 case "fillMaterial": 205 case "fillMaterial":
144 var m = this.getShapeProperty(el, p); 206 var m = this.getShapeProperty(el, p);