1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 22:00:03 -04:00

Implement trackpad pinch-to-zoom for plots in egui_web (#333)

This adds a new `zoom_delta` to input.
This is hooked up to ctrl-scroll on egui_web and egui_glium.

Browsers convert trackpad pinch gestures to ctrl-scroll,
so this means you can not pinch-to-zoom plots (on trackpad).

In the future we can support multitouch pinch-to-zoom via the same
`InputState::zoom_factor()` function
This commit is contained in:
Emil Ernerfeldt
2021-04-25 17:04:34 +02:00
committed by GitHub
parent 7f0689e566
commit c2744a1437
8 changed files with 72 additions and 29 deletions

View File

@@ -90,6 +90,8 @@ impl PlotDemo {
ui.checkbox(proportional, "proportional data axes");
});
});
ui.label("Drag to pan, ctrl + scroll to zoom. Double-click to reset view.");
}
fn circle(&self) -> Curve {