cc.LayerGradient is broken in Firefox #610

ricardoquesada opened this Issue Nov 2, 2012 · 5 comments


None yet

3 participants


cc.LayerGradient works ok on Chrome and Safari, but it looks really bad in Firefox.

Tested on Firefox 16.0.2, in OS X 10.7.4

How to test it:
Run the Layer Test, and go to the Gradient subtest

linshun commented Nov 3, 2012

Thank you, Riq. Dingping will look into this problem.


So, apparently it is possible to have nice gradients in FF by using createLinearGradient.
If you want to "rotate" it, you have to change the coordinates.
Official documentation:
Example of "rotated" gradients:

CCLayer.js is using createFillRect and I think we have to replace it with createLinearGradient in FF browsers.


LayerColor is only one color, so I think using fillRect is better than createLinearGradient.

and Gradient effect by change the coordinates is different to openGL. I will using this way to implement LayerGradient at first, but because this reason, I select other way.

OK, I will using createLinearGradient to implement LayerGradient soon.


Thanks, working correctly on FF now, but there the new approach introduced a new bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment