aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-06-25 20:27:17 -0700
committerJose Antonio Marquez2012-06-25 20:27:17 -0700
commit6ecc23f6c56a7e37f466d5ea59d995f75ada941a (patch)
tree81389d58c80db4ecf961d54eb633c567e9b0d879
parent6a437087e6956904c3b4ff6a09f3cb61d2feb94d (diff)
downloadninja-6ecc23f6c56a7e37f466d5ea59d995f75ada941a.tar.gz
Fixing alpha bugs on color chips
Getting the right value of alpha on reopening color chips.
-rwxr-xr-xjs/panels/color/colorpopup-manager.js28
1 files changed, 22 insertions, 6 deletions
diff --git a/js/panels/color/colorpopup-manager.js b/js/panels/color/colorpopup-manager.js
index a8e3ba6c..fd5a3239 100755
--- a/js/panels/color/colorpopup-manager.js
+++ b/js/panels/color/colorpopup-manager.js
@@ -258,7 +258,7 @@ exports.ColorPopupManager = Montage.create(Component, {
258 cvs = this._popupChipBtn.getElementsByTagName('canvas')[0], 258 cvs = this._popupChipBtn.getElementsByTagName('canvas')[0],
259 rgb = this._popupChipBase.colorManager.rgb, 259 rgb = this._popupChipBase.colorManager.rgb,
260 hsl = this._popupChipBase.colorManager.hsl, 260 hsl = this._popupChipBase.colorManager.hsl,
261 alpha = this._popupChipBase.colorManager.alpha.value; 261 alpha = this._popupChipBase.colorManager.alpha.value || this._popupChipBase.colorManager.alpha;
262 // 262 //
263 if (cvs) { 263 if (cvs) {
264 ctx = cvs.getContext('2d'); 264 ctx = cvs.getContext('2d');
@@ -284,9 +284,17 @@ exports.ColorPopupManager = Montage.create(Component, {
284 } 284 }
285 // 285 //
286 if (rgb) { 286 if (rgb) {
287 this._popupChipBtn.color('rgb', {r: rgb.r, g: rgb.g, b: rgb.b, a: alpha, css: 'rgba('+rgb.r+', '+rgb.g+', '+rgb.b+', '+alpha+')'}); 287 if (alpha) {
288 this._popupChipBtn.color('rgb', {r: rgb.r, g: rgb.g, b: rgb.b, a: alpha, css: 'rgba('+rgb.r+', '+rgb.g+', '+rgb.b+', '+alpha+')'});
289 } else {
290 this._popupChipBtn.color('rgb', {r: rgb.r, g: rgb.g, b: rgb.b, a: 1, css: 'rgba('+rgb.r+', '+rgb.g+', '+rgb.b+', 1)'});
291 }
288 } else { 292 } else {
289 this._popupChipBtn.color('rgb', {r: 255, g: 255, b: 255, a: alpha, css: 'rgba(255, 255, 255, '+alpha+')'}); 293 if (alpha) {
294 this._popupChipBtn.color('rgb', {r: 255, g: 255, b: 255, a: alpha, css: 'rgba(255, 255, 255, '+alpha+')'});
295 } else {
296 this._popupChipBtn.color('rgb', {r: 255, g: 255, b: 255, a: 1, css: 'rgba(255, 255, 255, 1)'});
297 }
290 } 298 }
291 } 299 }
292 }, 300 },
@@ -301,7 +309,7 @@ exports.ColorPopupManager = Montage.create(Component, {
301 cvs = this._popupGradientChipBtn.getElementsByTagName('canvas')[0], 309 cvs = this._popupGradientChipBtn.getElementsByTagName('canvas')[0],
302 rgb = this._popupGradientChipBase.colorManager.rgb, 310 rgb = this._popupGradientChipBase.colorManager.rgb,
303 hsl = this._popupGradientChipBase.colorManager.hsl, 311 hsl = this._popupGradientChipBase.colorManager.hsl,
304 alpha = this._popupGradientChipBase.colorManager.alpha.value; 312 alpha = this._popupGradientChipBase.colorManager.alpha.value || this._popupGradientChipBase.colorManager.alpha;
305 // 313 //
306 if (cvs) { 314 if (cvs) {
307 ctx = cvs.getContext('2d'); 315 ctx = cvs.getContext('2d');
@@ -327,9 +335,17 @@ exports.ColorPopupManager = Montage.create(Component, {
327 } 335 }
328 // 336 //
329 if (rgb) { 337 if (rgb) {
330 this._popupGradientChipBtn.color('rgb', {r: rgb.r, g: rgb.g, b: rgb.b, a: alpha, css: 'rgba('+rgb.r+', '+rgb.g+', '+rgb.b+', '+alpha+')'}); 338 if (alpha) {
339 this._popupGradientChipBtn.color('rgb', {r: rgb.r, g: rgb.g, b: rgb.b, a: alpha, css: 'rgba('+rgb.r+', '+rgb.g+', '+rgb.b+', '+alpha+')'});
340 } else {
341 this._popupGradientChipBtn.color('rgb', {r: rgb.r, g: rgb.g, b: rgb.b, a: 1, css: 'rgba('+rgb.r+', '+rgb.g+', '+rgb.b+', 1)'});
342 }
331 } else { 343 } else {
332 this._popupGradientChipBtn.color('rgb', {r: 255, g: 255, b: 255, a: alpha, css: 'rgba(255, 255, 255, '+alpha+')'}); 344 if (alpha) {
345 this._popupGradientChipBtn.color('rgb', {r: 255, g: 255, b: 255, a: alpha, css: 'rgba(255, 255, 255, '+alpha+')'});
346 } else {
347 this._popupGradientChipBtn.color('rgb', {r: 255, g: 255, b: 255, a: 1, css: 'rgba(255, 255, 255, 1)'});
348 }
333 } 349 }
334 } 350 }
335 }, 351 },