diff options
author | Nivesh Rajbhandari | 2012-06-04 17:11:06 -0700 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-06-04 17:12:36 -0700 |
commit | d44f3196c925332dcaf45f7cf8c64e22a1994bb9 (patch) | |
tree | 770ac0df9b73ee8fad584bfd1708ed2866910c92 /js/controllers/elements | |
parent | c1ec69879028220b0c3f11ad6e24035bf527802c (diff) | |
download | ninja-d44f3196c925332dcaf45f7cf8c64e22a1994bb9.tar.gz |
Fill and Ink-Bottle fixes.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js/controllers/elements')
-rwxr-xr-x | js/controllers/elements/element-controller.js | 24 | ||||
-rwxr-xr-x | js/controllers/elements/shapes-controller.js | 38 |
2 files changed, 62 insertions, 0 deletions
diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js index 01e132d7..fd4d3c12 100755 --- a/js/controllers/elements/element-controller.js +++ b/js/controllers/elements/element-controller.js | |||
@@ -225,6 +225,30 @@ exports.ElementController = Montage.create(Component, { | |||
225 | } | 225 | } |
226 | }, | 226 | }, |
227 | 227 | ||
228 | getFill: { | ||
229 | value: function(el, fill) { | ||
230 | var fillInfo = {}, | ||
231 | color; | ||
232 | if(fill.colorInfo) { | ||
233 | fillInfo.colorInfo = {}; | ||
234 | color = this.getColor(el, true); | ||
235 | if(color && color.color) { | ||
236 | fillInfo.colorInfo.mode = color.mode; | ||
237 | fillInfo.colorInfo.color = color.color; | ||
238 | } else { | ||
239 | fillInfo.colorInfo.mode = "nocolor"; | ||
240 | fillInfo.colorInfo.color = null; | ||
241 | } | ||
242 | } | ||
243 | return fillInfo; | ||
244 | } | ||
245 | }, | ||
246 | |||
247 | setFill: { | ||
248 | value: function(el, fill, eventType, source) { | ||
249 | this.setColor(el, fill.colorInfo, true); | ||
250 | } | ||
251 | }, | ||
228 | //-------------------------------------------------------------------------------------------------------- | 252 | //-------------------------------------------------------------------------------------------------------- |
229 | // Routines to get/set 3D properties | 253 | // Routines to get/set 3D properties |
230 | get3DProperty: { | 254 | get3DProperty: { |
diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js index 626dedb6..f19aaffb 100755 --- a/js/controllers/elements/shapes-controller.js +++ b/js/controllers/elements/shapes-controller.js | |||
@@ -584,6 +584,44 @@ exports.ShapesController = Montage.create(CanvasController, { | |||
584 | } | 584 | } |
585 | }, | 585 | }, |
586 | 586 | ||
587 | getFill: { | ||
588 | value: function(el, fill) { | ||
589 | var fillInfo = {}, | ||
590 | color; | ||
591 | if(fill.colorInfo) { | ||
592 | fillInfo.colorInfo = {}; | ||
593 | color = this.getColor(el, true); | ||
594 | if(color && color.color) { | ||
595 | fillInfo.colorInfo.mode = color.mode; | ||
596 | fillInfo.colorInfo.color = color.color; | ||
597 | } else { | ||
598 | fillInfo.colorInfo.mode = "nocolor"; | ||
599 | fillInfo.colorInfo.color = null; | ||
600 | } | ||
601 | } | ||
602 | if(fill.webGLInfo) { | ||
603 | fillInfo.webGLInfo = {}; | ||
604 | if(this.getShapeProperty(el, "useWebGl")) { | ||
605 | fillInfo.webGLInfo.material = this.getProperty("fillMaterial"); | ||
606 | } else { | ||
607 | fillInfo.webGLInfo.material = null; | ||
608 | } | ||
609 | } | ||
610 | return fillInfo; | ||
611 | } | ||
612 | }, | ||
613 | |||
614 | setFill: { | ||
615 | value: function(el, fill, eventType, source) { | ||
616 | if(fill.colorInfo) { | ||
617 | this.setColor(el, fill.colorInfo, true); | ||
618 | } | ||
619 | if(fill.webGLInfo) { | ||
620 | this.setProperty(el, "fillMaterial", fill.webGLInfo.material, eventType, source); | ||
621 | } | ||
622 | } | ||
623 | }, | ||
624 | |||
587 | DisplayMaterials: { | 625 | DisplayMaterials: { |
588 | value: function (cb) | 626 | value: function (cb) |
589 | { | 627 | { |