1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 14:20:04 -04:00

Better documentation for Event::Zoom (#4778)

* Closes https://github.com/emilk/egui/issues/4777

Also add this to the 0.28 migration guide.
This commit is contained in:
Emil Ernerfeldt
2024-07-04 10:31:27 +02:00
committed by GitHub
parent 8bf498d2bf
commit 042e1add41
3 changed files with 10 additions and 1 deletions

View File

@@ -426,10 +426,16 @@ pub enum Event {
/// On touch-up first send `PointerButton{pressed: false, …}` followed by `PointerLeft`.
PointerGone,
/// Zoom scale factor this frame (e.g. from ctrl-scroll or pinch gesture).
/// Zoom scale factor this frame (e.g. from a pinch gesture).
///
/// * `zoom = 1`: no change.
/// * `zoom < 1`: pinch together
/// * `zoom > 1`: pinch spread
///
/// Note that egui also implement zooming by holding `Ctrl` and scrolling the mouse wheel,
/// so integration need NOT emit this `Zoom` event in those cases, just [`Self::MouseWheel`].
///
/// As a user, check [`crate::InputState::smooth_scroll_delta`] to see if the user did any zooming this frame.
Zoom(f32),
/// IME Event

View File

@@ -27,6 +27,8 @@ const MAX_DOUBLE_CLICK_DELAY: f64 = 0.3; // TODO(emilk): move to settings
/// Input state that egui updates each frame.
///
/// You can access this with [`crate::Context::input`].
///
/// You can check if `egui` is using the inputs using
/// [`crate::Context::wants_pointer_input`] and [`crate::Context::wants_keyboard_input`].
#[derive(Clone, Debug)]