Skip to content
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

Zoom values outside zoom_min and zoom_max #883

Open
andreasdymek opened this issue Jul 19, 2024 · 2 comments
Open

Zoom values outside zoom_min and zoom_max #883

andreasdymek opened this issue Jul 19, 2024 · 2 comments

Comments

@andreasdymek
Copy link

Logging the editor.zoom values shows that zoom values may at times go outside of the given range of [editor.zoom_min, editor.zoom_max]. I propose when calculating editor.zoom to check if the value is inside the range and if not hardcode it to the provided min and max. Further, it might be worth to explore rounding results to avoid javascripts floating error.

@jerosoler
Copy link
Owner

It will probably be because the number is not rounded. You can also listen to the event and round the zoom.

Does it cause any problems in the UI?

@andreasdymek
Copy link
Author

I wanted to include a background grid (using css background properties) in the editor. Due to the editor.zoom values, it was not possible to calculate a precise offset for simulating moving into the center. The same holds for the values in the translation event btw.

I solved the issue though by using independent numbers and an independent div for background!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants