-
Notifications
You must be signed in to change notification settings - Fork 1k
[bug] Zoom in/out broken after selecting "Zoom to Fit" #2069
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@Kitenite what causing the bug
This fallback position logic:
bypasses any dynamic calculation and leads to misaligned centering, particularly when dimensions change or content is rendered in an iframe.
Temp Solution : We can try dynamic centering calculations
issue: Still results in NaN% when contentRect or containerRect have invalid or uninitialized dimensions. Better solution: with Viewport + iFrame-Aware Scaling
Dropping my PR for this. |
…er dimension validation and error handling - Improve scale calculation with finite number checks - Ensure zoom in/out functionality works correctly after zoom to fit - Fixes onlook-dev#2069
…er dimension validation and error handling - Improve scale calculation with finite number checks - Fixes onlook-dev#2069
* fix: resolve NaN% zoom issue after 'Zoom to Fit' selection - Add proper dimension validation and error handling - Improve scale calculation with finite number checks - Fixes #2069
Summary:
After selecting the "Zoom to Fit" option, the zoom value becomes NaN%, and subsequent zoom in or zoom out actions do not work.
Steps to reproduce:
Actual result:
The zoom display shows NaN%.
Zooming in or out does not have any effect.
https://github.com/user-attachments/assets/d6a3ec78-b421-4c23-9d14-cfe66f04c742
Expected result:
The zoom level should display a valid percentage after selecting "Zoom to Fit".
Zoom in and zoom out functions should work correctly afterward.
The text was updated successfully, but these errors were encountered: