Expand description
The application’s way into each step of the viewport’s lifecycle.
Experimental: may change in any release
(docs/stability.md).
The widget does the plumbing; at each step an application may:
- observe: every change is a
SignalinViewportOutput::signals(forward them to the host’s journal); - veto or redirect: a before hook answers a
Verdict(clamp the zoom, keep the view inside the image, snap a handle); - replace: a run hook takes the place of the default action and
may call it (
Hooks::on_double_click); - extend: an after hook adds to what was done
(
Hooks::under_overlaysdraws over the image and under the overlays,Hooks::after_paintover everything).
Every hook is optional; without one the default applies. What hooks
decided is kept in the state’s trace
and shown by the debug bridge’s viewport collector.
Structs§
- Handle
Move - A handle move the widget proposes.
- Hooks
- The hooks of one viewport (all optional). Set them on the
ViewportStatewithhooks_mut. - Trace
Entry - One decision of a hook, kept for the debug bridge.
- View
Change - A change of view the widget proposes.
Enums§
- Cause
- What made the view change (shared with every image canvas,
egui_pop_core::pointer::view). What made a view change. - Verdict
- What a before hook decides.
Constants§
- TRACE_
KEPT - How many trace entries a state keeps.