aboutsummaryrefslogtreecommitdiff
path: root/js/components/tools-properties/brush-properties.reel/brush-properties.js
diff options
context:
space:
mode:
authorhwc4872012-05-17 08:58:52 -0700
committerhwc4872012-05-17 08:58:52 -0700
commita73034090b30d79a0722fc5d32e081f35d2c7f5c (patch)
tree1c7a8c519a3d2e2f52df73511281918c6c70449a /js/components/tools-properties/brush-properties.reel/brush-properties.js
parentcb37bee07085690d72e69a82e76cae9166e5f0f1 (diff)
parentc37a876b373ddc7cb19277aaeaa6bb2d2d5a50ac (diff)
downloadninja-a73034090b30d79a0722fc5d32e081f35d2c7f5c.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into 3DBugs
Diffstat (limited to 'js/components/tools-properties/brush-properties.reel/brush-properties.js')
-rwxr-xr-xjs/components/tools-properties/brush-properties.reel/brush-properties.js49
1 files changed, 48 insertions, 1 deletions
diff --git a/js/components/tools-properties/brush-properties.reel/brush-properties.js b/js/components/tools-properties/brush-properties.reel/brush-properties.js
index fdcd50f8..7a0d21f1 100755
--- a/js/components/tools-properties/brush-properties.reel/brush-properties.js
+++ b/js/components/tools-properties/brush-properties.reel/brush-properties.js
@@ -8,7 +8,46 @@ var Montage = require("montage/core/core").Montage;
8var Component = require("montage/ui/component").Component; 8var Component = require("montage/ui/component").Component;
9var ToolProperties = require("js/components/tools-properties/tool-properties").ToolProperties; 9var ToolProperties = require("js/components/tools-properties/tool-properties").ToolProperties;
10 10
11exports.BrushProperties = Montage.create(ToolProperties, { 11var BrushProperties = exports.BrushProperties = Montage.create(ToolProperties, {
12 addedColorChips: { value: false },
13
14 _fill: {
15 enumerable: false,
16 value: { colorMode: 'rgb', color: { r: 0, g: 0, b: 0, a: 1, css: 'rgb(0,0,0)', mode: 'rgb', wasSetByCode: true, type: 'change' }, webGlColor: [0, 0, 0, 1] }
17 },
18
19 fill: {
20 enumerable: true,
21 get: function () {
22 return this._fill;
23 },
24 set: function (value) {
25 if (value !== this._fill) {
26 this._fill = value;
27 }
28 }
29 },
30
31 draw: {
32 enumerable: false,
33 value: function () {
34 Object.getPrototypeOf(BrushProperties).draw.call(this);
35
36 if (this.addedColorChips === false && this.application.ninja.colorController.colorPanelDrawn) {
37 this._fillColorCtrl.props = { side: 'top', align: 'center', wheel: true, palette: true, gradient: false, image: false, nocolor: true, offset: -80 };
38 this.application.ninja.colorController.addButton("chip", this._fillColorCtrl);
39
40 this._fillColorCtrl.addEventListener("change", this.handleFillColorChange.bind(this), false);
41
42 this.addedColorChips = true;
43 }
44
45 if (this.addedColorChips) {
46 this._fillColorCtrl.color(this._fill.colorMode, this._fill.color);
47 }
48 }
49 },
50
12 _subPrepare: { 51 _subPrepare: {
13 value: function() { 52 value: function() {
14 this.handleChange(null); 53 this.handleChange(null);
@@ -36,6 +75,14 @@ exports.BrushProperties = Montage.create(ToolProperties, {
36 } 75 }
37 } 76 }
38 }, 77 },
78
79 handleFillColorChange: {
80 value: function (e) {
81 this.fill = e._event;
82 this.fill.webGlColor = this.application.ninja.colorController.colorModel.colorToWebGl(e._event.color);
83 }
84 },
85
39 strokeSize: { 86 strokeSize: {
40 get: function() { return this._strokeSize; } 87 get: function() { return this._strokeSize; }
41 }, 88 },