calder-gl / playground

A playground for rendering CalderGL programs in a browser.
https://calder-gl.herokuapp.com/
MIT License
0 stars 0 forks source link

Handle dropped frames when dragging the mouse #40

Closed davepagurek closed 5 years ago

davepagurek commented 5 years ago

In multiple places in interactions.ts, we use event.movementX and event.movementY. This is supposed to be the difference since the last event, but it appears that when frames are dropped, these values are still relative to the dropped events, so any mouse-based adjustments feel slower than they should.

Instead, we should probably store the last values of event.clientX and event.clientY, and on a mouse move event, compare new values to old values to get a more accurate delta.