fillColor broken on new browsers
Hi,
Kinetic.js currently uses context.fill(context) wrongly. It should just be context.fill(). Apparently current browsers did not cause an exception there but with Firefox 21 there is now a parameter it takes so it errors out with "TypeError: Value '[object CanvasRenderingContext2D]' is not a valid value for enumeration CanvasWindingRule. @ http://d3lp1msu2r81bx.cloudfront.net/kjs/js/lib/kinetic-v4.3.1.js:672"
Old:
Kinetic.SceneCanvas.prototype = {
_fillColor: function(shape) {
var context = this.context, fill = shape.getFill();
context.fillStyle = fill;
context.fill(context);
},
Fixed:
Kinetic.SceneCanvas.prototype = {
_fillColor: function(shape) {
var context = this.context, fill = shape.getFill();
context.fillStyle = fill;
context.fill();
},
interesting thanks! I'll fix this up before the next release.
Thanks!
Thanks! Fixed up now.
Thanks for this. I was scratching my head for some time about this problem. Where can the fixed source be downloaded? I keep getting the old code when I download it from the main page (http://d3lp1msu2r81bx.cloudfront.net/kjs/js/lib/kinetic-v4.3.1.js).
In the meantime, apart from line 672, the same correction should be applied in lines 691, 701, 711 and 796, in order to make it work on Chrome 26.0.1397.2 dev-m. It still works in Firefox 18 and IE9. Hope this helps.
You have two options:
- fork the project and do a build
- wait and download the official release sometime this week (will be v4.3.2)
OK, thanks. I thought it was already patched on the source. I'll stick with my corrections until next release. Thanks again.
Thankyou mitsuhiko . You saved my day .. Gratitude
np!
Thank you so much @mitsuhiko , your solution saved me a lot of time !
Thanks mitsuhiko , it's working now, Really helpful.