Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
MartijnHols
2y ago
0 comments
Save
Share
Add a click event listener to the body and overlay the event-coordinates on the canvas.
0 comments
3 comments · 1 top-level
top
newest
oldest
amelius
2y ago
· 2 in thread
Will the canvas allow you to hit-test the confetti piece given the coordinate?
eyelidlessness
2y ago
Canvas draws raster images, anything resembling an object in your drawing logic is already tracked separately by necessity. So regardless, you’d presumably check against whatever data model you’re using to determine what to draw.
lupire
2y ago
By what time the user clicks, there's no reason for the program to
need
to remember what they drew where.
1 more reply
j
/
k
navigate · click thread line to collapse