aboutsummaryrefslogtreecommitdiff
path: root/js/components/tools-properties/brush-properties.reel/brush-properties.js
diff options
context:
space:
mode:
authorJohn Mayhew2012-05-07 14:30:47 -0700
committerJohn Mayhew2012-05-07 14:30:47 -0700
commit29ad6355ef60cfb3b3fc7f780504f3ed30845883 (patch)
treebbe2dcd46c98db8138ad0a8f0263ef33324d7669 /js/components/tools-properties/brush-properties.reel/brush-properties.js
parent1a759361b82127f9d5c1428dc889fffdf2daaf86 (diff)
downloadninja-29ad6355ef60cfb3b3fc7f780504f3ed30845883.tar.gz
More implementation of moving color chips to the individual subtools.
Removed the tool color bar Added new icons for inkbottle Removed Pencil tool Removed Inkbottle tool Added chips to the pen, brush and tag tools Aligned controls in several subtools
Diffstat (limited to 'js/components/tools-properties/brush-properties.reel/brush-properties.js')
-rwxr-xr-xjs/components/tools-properties/brush-properties.reel/brush-properties.js48
1 files changed, 47 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 677cd2d9..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);
@@ -37,6 +76,13 @@ exports.BrushProperties = Montage.create(ToolProperties, {
37 } 76 }
38 }, 77 },
39 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
40 strokeSize: { 86 strokeSize: {
41 get: function() { return this._strokeSize; } 87 get: function() { return this._strokeSize; }
42 }, 88 },