freshfork / p5.EasyCam

A p5.js library for easy 3D camera control.
https://freshfork.github.io/p5.EasyCam
MIT License
136 stars 33 forks source link

Dragging state persists when mouse is dragged outside canvas #22

Open rantonse opened 1 year ago

rantonse commented 1 year ago

If you click the mouse, drag the cursor outside of the canvas, and then release it, the dragging state persists until you click inside of the canvas again. In the MultiCanvas example, I can get all six to follow the mouse movements by clicking, dragging, and releasing each of them outside their canvases.

Thanks again for your work on this!

jwdunn1 commented 1 year ago

Thank you for reporting this issue. I will investigate.

jwdunn1 commented 1 year ago

The persistent drag state can be handled with an additional event handler on a sketch basis. See the updated MultiCanvas example. Additional references on this issue: stackoverflow.com/a/11533098 stackoverflow.com/a/11533211/4843719 jsfiddle.net/jWkCT editor.p5js.org/jwdunn1/sketches/QlPK6m_mL