diff options
author | Valerio Virgillito | 2012-03-29 15:40:59 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-03-29 15:40:59 -0700 |
commit | f4949cab544886702e7ad6eeaa6215125c7b067a (patch) | |
tree | b62d6319d6e9aa2c447597c3a2ccde5472da4738 /js/controllers/elements | |
parent | 3fd2cdb59027b3f973b9165db9db4fdd22026941 (diff) | |
parent | fa5c9dbdc3e8618d494e142e0967fa69049d0c97 (diff) | |
download | ninja-f4949cab544886702e7ad6eeaa6215125c7b067a.tar.gz |
Merge pull request #147 from pushkarjoshi/brushtool
Brushtool
Diffstat (limited to 'js/controllers/elements')
-rwxr-xr-x | js/controllers/elements/shapes-controller.js | 62 |
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); |