diff options
author | Nivesh Rajbhandari | 2012-03-12 12:00:07 -0700 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-03-12 12:00:07 -0700 |
commit | 2c6339a9191033c937c2bac3e181c2bc380f4c48 (patch) | |
tree | f5b6b66c578d77f3db3373ff9521519d107fc33a /js/tools | |
parent | e44238821c6b19a4b2259d26e14847b9995338f2 (diff) | |
download | ninja-2c6339a9191033c937c2bac3e181c2bc380f4c48.tar.gz |
Fixed element mediator, PI, and eye-dropper to handle different borders sides and gradients.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js/tools')
-rwxr-xr-x | js/tools/EyedropperTool.js | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/js/tools/EyedropperTool.js b/js/tools/EyedropperTool.js index 6e71c693..927b86cf 100755 --- a/js/tools/EyedropperTool.js +++ b/js/tools/EyedropperTool.js | |||
@@ -152,10 +152,14 @@ exports.EyedropperTool = Montage.create(toolBase, { | |||
152 | { | 152 | { |
153 | color = this.application.ninja.colorController.getColorObjFromCss(c); | 153 | color = this.application.ninja.colorController.getColorObjFromCss(c); |
154 | } | 154 | } |
155 | else | 155 | else if(c.mode !== "gradient") |
156 | { | 156 | { |
157 | color = this.application.ninja.colorController.getColorObjFromCss(c.color.css); | 157 | color = this.application.ninja.colorController.getColorObjFromCss(c.color.css); |
158 | } | 158 | } |
159 | else | ||
160 | { | ||
161 | color = c; | ||
162 | } | ||
159 | } | 163 | } |
160 | 164 | ||
161 | this._updateColor(color, false); | 165 | this._updateColor(color, false); |
@@ -175,7 +179,8 @@ exports.EyedropperTool = Montage.create(toolBase, { | |||
175 | if(updateColorToolBar) | 179 | if(updateColorToolBar) |
176 | { | 180 | { |
177 | eventType = "change"; | 181 | eventType = "change"; |
178 | if (color && color.value) | 182 | // TODO - Color chips in toolbar doesn't support gradients yet |
183 | if (color && color.value && (color.mode !== "gradient")) | ||
179 | { | 184 | { |
180 | var input = this.application.ninja.colorController.colorModel.input; | 185 | var input = this.application.ninja.colorController.colorModel.input; |
181 | 186 | ||
@@ -295,10 +300,10 @@ exports.EyedropperTool = Montage.create(toolBase, { | |||
295 | x = tmpPt[0]; | 300 | x = tmpPt[0]; |
296 | y = tmpPt[1]; | 301 | y = tmpPt[1]; |
297 | 302 | ||
298 | if(x < innerBounds[0][0]) return ElementsMediator.getProperty(elt, "border-left-color"); | 303 | if(x < innerBounds[0][0]) return ElementsMediator.getColor(elt, false, "left"); |
299 | if(x > innerBounds[2][0]) return ElementsMediator.getProperty(elt, "border-right-color"); | 304 | if(x > innerBounds[2][0]) return ElementsMediator.getColor(elt, false, "right"); |
300 | if(y < innerBounds[0][1]) return ElementsMediator.getProperty(elt, "border-top-color"); | 305 | if(y < innerBounds[0][1]) return ElementsMediator.getColor(elt, false, "top"); |
301 | if(y > innerBounds[1][1]) return ElementsMediator.getProperty(elt, "border-bottom-color"); | 306 | if(y > innerBounds[1][1]) return ElementsMediator.getColor(elt, false, "bottom"); |
302 | } | 307 | } |
303 | 308 | ||
304 | return ElementsMediator.getColor(elt, true); | 309 | return ElementsMediator.getColor(elt, true); |