diff options
author | Pushkar Joshi | 2012-06-07 09:53:44 -0700 |
---|---|---|
committer | Pushkar Joshi | 2012-06-07 09:53:44 -0700 |
commit | 1a40c4a3e1817004d1ce1c600ae4857fdd94a97a (patch) | |
tree | 25836d69f77472f60bab9a14c23865a3899a60d8 /js/tools/InkBottleTool.js | |
parent | 763baf19f032c6fbae18963402b79d5d5510d923 (diff) | |
parent | 47e0e1f047e83b71c3f86812a45d33904201cc7a (diff) | |
download | ninja-1a40c4a3e1817004d1ce1c600ae4857fdd94a97a.tar.gz |
Merge branch 'master' into brushtool
Diffstat (limited to 'js/tools/InkBottleTool.js')
-rwxr-xr-x | js/tools/InkBottleTool.js | 50 |
1 files changed, 29 insertions, 21 deletions
diff --git a/js/tools/InkBottleTool.js b/js/tools/InkBottleTool.js index 2c03d133..c5640b10 100755 --- a/js/tools/InkBottleTool.js +++ b/js/tools/InkBottleTool.js | |||
@@ -65,43 +65,51 @@ exports.InkBottleTool = Montage.create(ModifierToolBase, { | |||
65 | // Called by modifier tool base's HandleLeftButtonDown after updating selection (if needed) | 65 | // Called by modifier tool base's HandleLeftButtonDown after updating selection (if needed) |
66 | startDraw: { | 66 | startDraw: { |
67 | value: function(event) { | 67 | value: function(event) { |
68 | this.drawData = null; | ||
68 | this.isDrawing = true; | 69 | this.isDrawing = true; |
69 | 70 | ||
70 | if(this._canColor && this.application.ninja.selectedElements.length) | 71 | if(this._canColor && this.application.ninja.selectedElements.length) |
71 | { | 72 | { |
72 | var color = this.options.stroke, | 73 | var strokeInfo = {}, |
73 | colorInfo; | 74 | color; |
74 | if(color && color.color) | 75 | if(this.options.useStrokeColor.checked) { |
75 | { | 76 | strokeInfo.colorInfo = {}; |
76 | colorInfo = { mode:color.colorMode, | 77 | color = this.options.stroke; |
77 | color:color.color | 78 | if(color && color.color) |
78 | }; | 79 | { |
79 | } | 80 | strokeInfo.colorInfo.mode = color.colorMode; |
80 | else | 81 | strokeInfo.colorInfo.color = color.color; |
81 | { | 82 | } else { |
82 | colorInfo = { mode:"nocolor", | 83 | strokeInfo.colorInfo.mode = "nocolor"; |
83 | color:color.color | 84 | strokeInfo.colorInfo.color = null; |
84 | }; | 85 | } |
85 | } | 86 | } |
86 | 87 | ||
87 | if(this.options.useBorderWidth.checked || this.options.useBorderStyle.checked) { | 88 | if(this.options.useBorderWidth.checked || this.options.useBorderStyle.checked) { |
88 | colorInfo.borderInfo = {}; | 89 | strokeInfo.borderInfo = {}; |
89 | if(this.options.useBorderWidth.checked) { | 90 | if(this.options.useBorderWidth.checked) { |
90 | colorInfo.borderInfo.borderWidth = this.options._borderWidth.value; | 91 | strokeInfo.borderInfo.borderWidth = this.options.borderWidth.value; |
91 | colorInfo.borderInfo.borderUnits = this.options._borderWidth.units; | 92 | strokeInfo.borderInfo.borderUnits = this.options.borderWidth.units; |
92 | } | 93 | } |
93 | if(this.options.useBorderStyle.checked) { | 94 | if(this.options.useBorderStyle.checked) { |
94 | colorInfo.borderInfo.borderStyle = this.options._borderStyle.value; | 95 | strokeInfo.borderInfo.borderStyle = this.options.borderStyle.value; |
95 | } | 96 | } |
96 | } | 97 | } |
97 | 98 | ||
98 | if(this.options.useStrokeSize.checked) { | 99 | if(this.options.useStrokeSize.checked) { |
99 | colorInfo.strokeInfo = {}; | 100 | strokeInfo.shapeInfo = {}; |
100 | colorInfo.strokeInfo.strokeSize = this.options._strokeSize.value; | 101 | strokeInfo.shapeInfo.strokeSize = this.options.strokeSize.value; |
101 | colorInfo.strokeInfo.strokeUnits = this.options._strokeSize.units; | 102 | strokeInfo.shapeInfo.strokeUnits = this.options.strokeSize.units; |
103 | } | ||
104 | |||
105 | if(this.options.useWebGL.checked) { | ||
106 | strokeInfo.webGLInfo = {}; | ||
107 | strokeInfo.webGLInfo.material = this.options.strokeMaterial.value; | ||
102 | } | 108 | } |
103 | 109 | ||
104 | ElementsMediator.setColor(this.application.ninja.selectedElements, colorInfo, false, "Change", "inkBottleTool"); | 110 | if(strokeInfo.colorInfo || strokeInfo.borderInfo || strokeInfo.shapeInfo || strokeInfo.webGLInfo) { |
111 | ElementsMediator.setStroke(this.application.ninja.selectedElements, strokeInfo, "Change", "inkBottleTool"); | ||
112 | } | ||
105 | } | 113 | } |
106 | } | 114 | } |
107 | } | 115 | } |