3 ms·
Register the mousemove event handler on window, then you will still get the events when the mouse moves out of the window/frame while dragging and it won't be t
by panzi 7mo ago
Register the mousemove event handler on window, then you will still get the events when the mouse moves out of the window/frame while dragging and it won't be that buggy.
- DaanDL 7mo agoWas about to comment the same. It's a common mistake/gotcha.
- benrutter 7mo agoPossibly dumb question, but does that still hold inside p5js?
- virgil_disgr4ce 7mo agop5 is just a wrapper that adds the setup() and draw() functions, so yes
- pierrec 7mo agoCome on, HN, you can't let this information stay under the front page for 13 hours and everyone's like "ah yes of course". Please don't register the mousemove event handler on window, that old school hack never really worked and was obsoleted 10 years ago when the pointer API became standard. Things are much nicer now and the problem is entirely avoided by using pointer events: https://developer.mozilla.org/en-US/docs/Web/API/Element/setPointerCapture https://developer.mozilla.org/en-US/docs/Web/API/Element/set...