3 ms·
How did you implement hit testing for events? Does it draw on a second canvas with color hashing like konva js?
by aloer 5y ago
How did you implement hit testing for events? Does it draw on a second canvas with color hashing like konva js?
- rikroots 5y agoI use a combination of Path2D and ctx.isPointInPath() - code here[1], line 1502 onwards [1] https://github.com/KaliedaRik/Scrawl-canvas/blob/master/source/mixin/position.js https://github.com/KaliedaRik/Scrawl-canvas/blob/master/sour...