flekschas / regl-scatterplot

Scalable WebGL-based scatter plot library build with Regl
https://flekschas.github.io/regl-scatterplot/
MIT License
192 stars 24 forks source link

Fixed Issue#112 - isMouseInCanvas out of sync #113

Closed NOT-HAL9000 closed 1 year ago

NOT-HAL9000 commented 1 year ago

Fixed https://github.com/flekschas/regl-scatterplot/issues/112

Changed isMouseInCanvas from false to true on startup.

Behavior Before:

If the cursor is moved within the canvas before the initalization, the mouseMoveHandler registers isMouseInCanvas as false. The cursor must be moved out and back of the canvas to re-establish sync.

https://user-images.githubusercontent.com/70297791/230256743-e5446640-8179-426f-a673-6654b6ce8cd0.mp4

Behavior After:

The position of the cursor does not matter on startup. Behavior works as expected.

https://user-images.githubusercontent.com/70297791/230256818-bca0f981-cd19-413a-9272-958723391a65.mp4

NOT-HAL9000 commented 1 year ago

Untested for situation when mouse has moved around page before entering canvas element. Unknown side effects.