ericdrowell / KineticJS

KineticJS is an HTML5 Canvas JavaScript framework that extends the 2d context by enabling canvas interactivity for desktop and mobile applications.
http://www.kineticjs.com
3.98k stars 753 forks source link

Mouse events stop working with Firefox color-correction #1066

Closed zachkinstner closed 9 years ago

zachkinstner commented 9 years ago

This is likely more of a Firefox-level issue, but I noticed this issue specifically with KineticJS and wanted to document it somewhere. I'll close the issue after posting.

I have wide-gamut monitors, and so I adjusted Firefox settings to show corrected colors. The specific property is gfx.color_management.mode in the Firefox about:config page. I was using a value of 1, while the default is a value of 2.

While using the value of 1, I noticed that the mouse events were not working in KineticJS (like click, mouseover, etc.). Changing the value back to 2 resolved the issue.

My iniital debugging into the KineticJS code showed that this.hitCanvas.context._context.getImageData() in the _getIntersection() function was returning the wrong pixel color value, which prevents the code from finding the correct "hit" shape. The expected pixel color was the shape's colorKey value. I noticed that the returned color was always slightly darker, however, which made me think of that Firefox setting.

zachkinstner commented 9 years ago

These old/unresolved issues seem relevant: