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

egui::Context::set_zoom_factor does not work #338

Open
dgulotta opened this issue Dec 8, 2024 · 2 comments
Open

egui::Context::set_zoom_factor does not work #338

dgulotta opened this issue Dec 8, 2024 · 2 comments

Comments

@dgulotta
Copy link

dgulotta commented Dec 8, 2024

In Notan, calling egui::Context::set_zoom_factor does not change the size of the UI, only the sharpness of the UI elements. I checked that set_zoom_factor works correctly in eframe.

This is particularly unfortunate because egui's default font size on my system in either WebAssembly or Wine is about 5 points (with either notan or eframe).

@dgulotta
Copy link
Author

dgulotta commented Dec 9, 2024

A workaround is to use Context::style_mut to change all of the font sizes during initialization. One thing that was not obvious to me is that it's necessary to call Graphics::render on the egui output, even though there is nothing to render yet, or else the app crashes with the error "GL_INVALID_VALUE: Offset overflows texture dimensions."

@woelper
Copy link
Contributor

woelper commented Dec 30, 2024

I ran into this as well last week. This would be great for accessibility. I'll try your workaround @dgulotta , thank you for that! My use case would be to allow changing UI scale at runtime and not during initialization, I'll try if the workaround works in that case too.

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