-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add web support for zoom_factor
#4260
Conversation
Thank you very much for the library! I did my first bigger project in rust and am really happy with it, especially the ease with which one can create both a native and web application. My prof had some difficulty reading the text, and I can see how one might have problems, especially with the moderate text contrast in dark mode. So I created this PR because I would like to enlarge the website a bit by default |
The intent of the current behavior is that the web browser is in charge of the zoom-factor/pixels-per-point. If you launch a native egui app and press cmd-plus, you will zoom in, because egui catches that command and adjust the zoom factor. Do you want to be able to zoom an egui app independently of the browsers setting? |
Exactly, I don't want to override the browsers zoom level, but I would like to be able to adjust the zoom level of the application programmatically |
Makes sense - thanks for the PR! |
Before, when setting the `zoom_factor`, the website was already enlarged, but the zoom was ignored when calculating the logical window size and mouse position, causing an offset between the actual cursor and selected elements. That is addressed here --------- Co-authored-by: Emil Ernerfeldt <[email protected]>
## egui changelog ### 🐛 Fixed * Fix visual glitch on the right side of highly rounded rectangles [#4244](#4244) * Prevent visual glitch when shadow blur width is very high [#4245](#4245) * Fix `InputState::any_touches` and add `InputState::has_touch_screen` [#4247](#4247) * Fix `Context::repaint_causes` returning no causes [#4248](#4248) * Fix touch-and-hold to open context menu [#4249](#4249) * Hide shortcut text on zoom buttons if `zoom_with_keyboard` is false [#4262](#4262) ### 🔧 Changed * Don't apply a clip rect to the contents of an `Area` or `Window` [#4258](#4258) ## eframe changelog * Web: repaint if the `#hash` in the URL changes [#4261](#4261) * Add web support for `zoom_factor` [#4260](#4260) (thanks [@justusdieckmann](https://github.com/justusdieckmann)!) --------- Co-authored-by: Justus Dieckmann <[email protected]>
## egui changelog ### 🐛 Fixed * Fix visual glitch on the right side of highly rounded rectangles [#4244](emilk/egui#4244) * Prevent visual glitch when shadow blur width is very high [#4245](emilk/egui#4245) * Fix `InputState::any_touches` and add `InputState::has_touch_screen` [#4247](emilk/egui#4247) * Fix `Context::repaint_causes` returning no causes [#4248](emilk/egui#4248) * Fix touch-and-hold to open context menu [#4249](emilk/egui#4249) * Hide shortcut text on zoom buttons if `zoom_with_keyboard` is false [#4262](emilk/egui#4262) ### 🔧 Changed * Don't apply a clip rect to the contents of an `Area` or `Window` [#4258](emilk/egui#4258) ## eframe changelog * Web: repaint if the `#hash` in the URL changes [#4261](emilk/egui#4261) * Add web support for `zoom_factor` [#4260](emilk/egui#4260) (thanks [@justusdieckmann](https://github.com/justusdieckmann)!) --------- Co-authored-by: Justus Dieckmann <[email protected]>
Before, when setting the `zoom_factor`, the website was already enlarged, but the zoom was ignored when calculating the logical window size and mouse position, causing an offset between the actual cursor and selected elements. That is addressed here --------- Co-authored-by: Emil Ernerfeldt <[email protected]>
## egui changelog ### 🐛 Fixed * Fix visual glitch on the right side of highly rounded rectangles [emilk#4244](emilk#4244) * Prevent visual glitch when shadow blur width is very high [emilk#4245](emilk#4245) * Fix `InputState::any_touches` and add `InputState::has_touch_screen` [emilk#4247](emilk#4247) * Fix `Context::repaint_causes` returning no causes [emilk#4248](emilk#4248) * Fix touch-and-hold to open context menu [emilk#4249](emilk#4249) * Hide shortcut text on zoom buttons if `zoom_with_keyboard` is false [emilk#4262](emilk#4262) ### 🔧 Changed * Don't apply a clip rect to the contents of an `Area` or `Window` [emilk#4258](emilk#4258) ## eframe changelog * Web: repaint if the `#hash` in the URL changes [emilk#4261](emilk#4261) * Add web support for `zoom_factor` [emilk#4260](emilk#4260) (thanks [@justusdieckmann](https://github.com/justusdieckmann)!) --------- Co-authored-by: Justus Dieckmann <[email protected]>
Before, when setting the
zoom_factor
, the website was already enlarged, but the zoom was ignored when calculating the logical window size and mouse position, causing an offset between the actual cursor and selected elements. That is addressed here