dom-examples
dom-examples copied to clipboard
Fix pick coordinates relative to the image
Current code uses absolute mouse coordinates instead of relative to the canvas, which in turn makes the actual hovered/selected color inaccurate (there's an x/y offset that reads pixel further towards top/left direction) This diff hasn't been tested in the exact tutorial context, but seems to fix the bug and work fine in a simpler, similar unit test (which had the exact same issue)