gridviz
gridviz copied to clipboard
Zoom flickering
trafficstars
When zooming in quickly, there appears to be some zoom flickering (switching back and forth between zoom-levels)
I believe this is due to the fact that some redraw events may take longer than others (due to data fetching), meaning that when zooming in we can encounter a case where a 'lower' zoom level is drawn after a 'higher' zoom level which creates this flickering back and forth effect.
A solution to this might be something like:
Use a zoom-level tracking mechanism to associate each getData call with the current zoom level. Before processing the data or proceeding with further operations, check if the zoom level matches the most recent one. If not, ignore the outdated data.