diff options
author | hwc487 | 2012-02-21 17:02:31 -0800 |
---|---|---|
committer | hwc487 | 2012-02-21 17:02:31 -0800 |
commit | f06f44ab3fcca109f126eae4f6fb915c5dd28791 (patch) | |
tree | c25fbfedf93c135be53f1e9238f7ddcf498612bc /js/controllers/elements/shapes-controller.js | |
parent | bd7bc833895391e4974b8746f31f63ba70689df3 (diff) | |
parent | d2f4d5e5f6742d53b6324d585a700566f73c992a (diff) | |
download | ninja-f06f44ab3fcca109f126eae4f6fb915c5dd28791.tar.gz |
Merge branch 'WebGLMaterials' of github.com:mqg734/ninja-internal into integration
Diffstat (limited to 'js/controllers/elements/shapes-controller.js')
-rwxr-xr-x | js/controllers/elements/shapes-controller.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js index 15a18a51..e0bff70c 100755 --- a/js/controllers/elements/shapes-controller.js +++ b/js/controllers/elements/shapes-controller.js | |||
@@ -250,6 +250,10 @@ exports.ShapesController = Montage.create(CanvasController, { | |||
250 | setColor: { | 250 | setColor: { |
251 | value: function(el, color, isFill) { | 251 | value: function(el, color, isFill) { |
252 | var webGl = color.webGlColor || color.color.webGlColor; | 252 | var webGl = color.webGlColor || color.color.webGlColor; |
253 | if(!webGl) | ||
254 | { | ||
255 | webGl = this.application.ninja.colorController.colorModel.colorToWebGl(color.color); | ||
256 | } | ||
253 | if(isFill) | 257 | if(isFill) |
254 | { | 258 | { |
255 | el.elementModel.shapeModel.GLGeomObj.setFillColor(webGl); | 259 | el.elementModel.shapeModel.GLGeomObj.setFillColor(webGl); |
@@ -261,6 +265,14 @@ exports.ShapesController = Montage.create(CanvasController, { | |||
261 | el.elementModel.shapeModel.GLGeomObj.setStrokeColor(webGl); | 265 | el.elementModel.shapeModel.GLGeomObj.setStrokeColor(webGl); |
262 | this.setShapeProperty(el, "stroke", webGl); | 266 | this.setShapeProperty(el, "stroke", webGl); |
263 | this.setShapeProperty(el, "border", color); | 267 | this.setShapeProperty(el, "border", color); |
268 | if(color.strokeInfo) | ||
269 | { | ||
270 | var strokeWidth = this.GetValueInPixels(color.strokeInfo.strokeSize, | ||
271 | color.strokeInfo.strokeUnits); | ||
272 | el.elementModel.shapeModel.GLGeomObj.setStrokeWidth(strokeWidth); | ||
273 | this.setShapeProperty(el, "strokeSize", color.strokeInfo.strokeSize + " " | ||
274 | + color.strokeInfo.strokeUnits); | ||
275 | } | ||
264 | } | 276 | } |
265 | el.elementModel.shapeModel.GLWorld.render(); | 277 | el.elementModel.shapeModel.GLWorld.render(); |
266 | } | 278 | } |