p5.js is a client-side JS platform that empowers artists, designers, students, and anyone to learn to code and express themselves creatively on the web. It is based on the core principles of Processing. http://twitter.com/p5xjs —
Here are two sketches showing how it would work,
the shape is drawn two times, the first one for hit detection (drawn as transparent), and the second for styling (fill, stroke, ...)
Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, please make sure to fill out the inputs in the issue forms. Thank you!
Increasing access
Useful for mouse interaction (mousehover, mouseclick, etc.) on 2DShapes (rect, ellipse, beginShape, ...)
Most appropriate sub-area of p5.js?
Feature request details
Using CanvasRenderingContext2D: isPointInPath() and isPointInStroke() this could be doable.
Here are two sketches showing how it would work, the shape is drawn two times, the first one for hit detection (drawn as transparent), and the second for styling (fill, stroke, ...)
Example