Suppose I have a html5/canvas application in which I can place objects on a drawing-canvas. Some kind of diagram editor, something like Visio (but much simpler)
Is there a framework which helps me find which object is clicked/dragged?
An option is to capture the click-event and iterate over all my objects (in a semi-smart way) and check if it is clicked/dragged, but I hate to reinvent the wheel!
The short version is that Canvas itself keeps track of none of that.
If you don't want to reinvent the wheel, start with my sample code from the tutorial "Making and Moving Selectable Shapes on an HTML5 Canvas: A Simple Example." It provides a good introduction and platform for clicking and dragging.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With