aboutsummaryrefslogtreecommitdiff
path: root/js/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.js
diff options
context:
space:
mode:
authorJonathan Duran2012-05-22 10:32:03 -0700
committerJonathan Duran2012-05-22 10:32:03 -0700
commit7b76e4664b35f044e9f24c060f1e092cb5e5c4b0 (patch)
treef0f6168b083aa929d34f37edca6c87ce7c3743bd /js/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.js
parent0dc43f8b6d7db6d9ed698e8c4568e942d8e3d8eb (diff)
parentc37a876b373ddc7cb19277aaeaa6bb2d2d5a50ac (diff)
downloadninja-7b76e4664b35f044e9f24c060f1e092cb5e5c4b0.tar.gz
Merge branch 'refs/heads/NINJAmaster' into TimelineUber
Diffstat (limited to 'js/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.js')
-rwxr-xr-xjs/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.js48
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
11exports.InkBottleProperties = Montage.create(ToolProperties, { 11var 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() {