mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 06:40:06 -04:00
Add web support for zoom_factor (#4260)
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 <emil.ernerfeldt@gmail.com>
This commit is contained in:
@@ -185,6 +185,12 @@ pub struct Options {
|
||||
/// presses Cmd+Plus, Cmd+Minus or Cmd+0, just like in a browser.
|
||||
///
|
||||
/// This is `true` by default.
|
||||
///
|
||||
/// On the web-backend of `eframe` this is set to false by default,
|
||||
/// so that the zoom shortcuts are handled exclusively by the browser,
|
||||
/// which will change the `native_pixels_per_point` (`devicePixelRatio`).
|
||||
/// You can still zoom egui independently by calling [`crate::Context::set_zoom_factor`],
|
||||
/// which will be applied on top of the browsers global zoom.
|
||||
#[cfg_attr(feature = "serde", serde(skip))]
|
||||
pub zoom_with_keyboard: bool,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user