When I hit the "zoom to fit" button multiple times, I expect it to zoom to the same zoom level
i.e. I expect it to zoom once, and then additional button presses not to do anything
Putting it another way: the zoom level should depend on the contents of the editor and the viewport size, but it shouldn't depend on how many times the button is pressed
For example, visit https://main--fluxapp.netlify.app/cypress-test-user-7/ref-thermal-relief-interaction?editor=pcb_2d and with nothing selected, press the zoom to fit button - with a 1200px wide window
Then output
window.__FLUX__.controls.camera.zoom
  • The first button press gives a zoom of 53882.75962433426
  • The next button press gives a zoom of 53858.39838623916
  • The next button press gives a zoom of 53858.33450455445
and so on - it takes about five or six button presses before the value converges to the precision of a double-float.
This causes problems for visual tests, which are already hitting the zoom to fit button 2 or 3 times, but still ending up with differences in zoom level from run to run
The value should be deterministic, not just from button press to button press, but also on separate loads (for the same document content and viewport size)