diff options
Diffstat (limited to 'js/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.js')
-rwxr-xr-x | js/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.js | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/js/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.js b/js/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.js index 6d5c46f6..945df857 100755 --- a/js/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.js +++ b/js/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.js | |||
@@ -8,7 +8,53 @@ var Montage = require("montage/core/core").Montage, | |||
8 | ShapesController = require("js/controllers/elements/shapes-controller").ShapesController, | 8 | ShapesController = require("js/controllers/elements/shapes-controller").ShapesController, |
9 | ToolProperties = require("js/components/tools-properties/tool-properties").ToolProperties; | 9 | ToolProperties = require("js/components/tools-properties/tool-properties").ToolProperties; |
10 | 10 | ||
11 | exports.InkBottleProperties = Montage.create(ToolProperties, { | 11 | var InkBottleProperties = exports.InkBottleProperties = Montage.create(ToolProperties, { |
12 | addedColorChips: { value: false }, | ||
13 | |||
14 | _stroke: { | ||
15 | enumerable: false, | ||
16 | value: { colorMode: 'rgb', color: { r: 255, g: 255, b: 255, a: 1, css: 'rgb(255,255,255)', mode: 'rgb', wasSetByCode: true, type: 'change' }, webGlColor: [1, 1, 1, 1] } | ||
17 | }, | ||
18 | |||
19 | stroke: { | ||
20 | enumerable: true, | ||
21 | get: function () { | ||
22 | return this._stroke; | ||
23 | }, | ||
24 | set: function (value) { | ||
25 | if (value !== this._stroke) { | ||
26 | this._stroke = value; | ||
27 | } | ||
28 | } | ||
29 | }, | ||
30 | |||
31 | draw: { | ||
32 | enumerable: false, | ||
33 | value: function () { | ||
34 | Object.getPrototypeOf(InkBottleProperties).draw.call(this); | ||
35 | |||
36 | if (this.addedColorChips === false && this.application.ninja.colorController.colorPanelDrawn) { | ||
37 | // setup stroke color | ||
38 | this._strokeColorCtrl.props = { side: 'top', align: 'center', wheel: true, palette: true, gradient: false, image: false, nocolor: true, offset: -80 }; | ||
39 | this.application.ninja.colorController.addButton("chip", this._strokeColorCtrl); | ||
40 | |||
41 | this._strokeColorCtrl.addEventListener("change", this.handleStrokeColorChange.bind(this), false); | ||
42 | |||
43 | this.addedColorChips = true; | ||
44 | } | ||
45 | |||
46 | if (this.addedColorChips) { | ||
47 | this._strokeColorCtrl.color(this._stroke.colorMode, this._stroke.color); | ||
48 | } | ||
49 | } | ||
50 | }, | ||
51 | |||
52 | handleStrokeColorChange: { | ||
53 | value: function (e) { | ||
54 | this.stroke = e._event; | ||
55 | this.stroke.webGlColor = this.application.ninja.colorController.colorModel.colorToWebGl(e._event.color); | ||
56 | } | ||
57 | }, | ||
12 | 58 | ||
13 | _subPrepare: { | 59 | _subPrepare: { |
14 | value: function() { | 60 | value: function() { |