aboutsummaryrefslogtreecommitdiff
path: root/js/controllers/elements
diff options
context:
space:
mode:
Diffstat (limited to 'js/controllers/elements')
-rwxr-xr-xjs/controllers/elements/shapes-controller.js66
1 files changed, 66 insertions, 0 deletions
diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js
index 5b9e4672..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);
@@ -274,6 +336,10 @@ exports.ShapesController = Montage.create(CanvasController, {
274 color = this.getShapeProperty(el, "stroke"); 336 color = this.getShapeProperty(el, "stroke");
275 } 337 }
276 338
339 if(!css) {
340 return null;
341 }
342
277 css = this.application.ninja.colorController.colorModel.webGlToCss(color); 343 css = this.application.ninja.colorController.colorModel.webGlToCss(color);
278 return this.application.ninja.colorController.getColorObjFromCss(css); 344 return this.application.ninja.colorController.getColorObjFromCss(css);
279 } 345 }