Skip to main content

Module widget

Module widget 

Source
Expand description

The viewport widget: draws a view of an image and turns gestures into changes of the View, reported as Signals.

Experimental: may change in any release (docs/stability.md).

The application owns the view (per window or per document) and the ViewportState (what the widget keeps between frames, its hooks included). Every change the widget makes goes through the before_view hook and is reported as a signal with its phase, so an application that keeps the view in a store records a pan as one gesture, and a cancelled pan as nothing.

Structs§

Viewport
The viewport widget, built per frame.
ViewportOutput
What a frame of the viewport gives back.
ViewportState
What the widget keeps between frames. One per viewport; the application owns it.

Enums§

Compare
Before and after: what the viewport shows of the “before” image.
Phase
Where a change stands in its gesture (shared with every image canvas, egui_pop_core::pointer::view). Where a change stands in its gesture.
Signal
What the viewport tells the application.

Constants§

GRID_FROM_ZOOM
From this zoom up, the pixel grid shows (when enabled).

Functions§

readout_text
The readout’s text: the on_readout hook’s, or the pixel and its values.
zoom_percent
The zoom of a view as shown, in percent (fit resolved by mapping).