Expand description
A view’s pointer gestures (the image viewport’s, the node graph’s, the
library’s comparison): what the profile in force makes the wheel, a
scroll, a pinch, each click, double click and drag do, and the one
wheel path every zoomable view reads (view_wheel), so the same
gesture does the same thing in each.
The image canvases share more: the view model (View, Mapping,
the zoom ladder) and the gestures themselves (CanvasGestures, run
over a ZoomPan by pan, click, double_click, wheel
and keys), so the image viewport and each pane of the library’s
comparison change their view the same way.
Experimental: may change in any release
(docs/stability.md).
Structs§
- Canvas
Gestures - An image canvas’s gestures, as data so an input profile can remap them: the pointer’s from the profile in force, the keys as by default.
- Gesture
State - What a canvas keeps between frames for its gestures.
- Mapping
- The mapping between image pixels, physical pixels and points for one
frame of one viewport in one window. Build it with
Mapping::new; every conversion of the viewport (drawing, tiles, hit tests, the readout) goes through it. - View
- What is shown: a zoom and the image point at the centre of the view. The application owns it (a window, a document); the viewport changes it through gestures and says so with signals.
- View
Gestures - A view’s pointer gestures: per set of modifiers (
index), what the wheel, a scroll and a pinch do, what a click and a double click of each button do, and which buttons’ drags pan.
Enums§
- Cause
- What made a view change.
- Phase
- Where a change stands in its gesture.
- View
Action - What a pointer gesture does to a view.
- View
Wheel - One wheel, scroll or pinch input as a view’s gestures read it.
- Zoom
- How the zoom is chosen.
Constants§
- MAX_
ZOOM - The largest zoom.
- MIN_
ZOOM - The smallest zoom (a very large image fitted in a small view).
- WHEEL_
RATE - How fast the wheel zooms: the factor per point of scroll is
exp(points × WHEEL_RATE)(wheel_factor). - ZOOM_
LADDER - The zoom steps of
zoom_inandzoom_out, in physical pixels per image pixel: whole ratios first (100 % is1.0).
Traits§
- ZoomPan
- A zoomable, pannable view the canvas gestures drive: its view and mapping this frame, and what it does with a change.
Functions§
- canvas_
gestures - The image canvases’ gestures in a context: those set, else the pointer profile’s.
- click
- A click the profile gives a view action (a middle click cycling the zoom, a primary click toggling fit and 100 %).
- click_
view - The view a click-like action leads to from
view(None: no change). - double_
click - A primary double click: the profile’s view action (fit, 100 % and
back, the zoom cycle, leave), through
ZoomPan::double_click. - fit_
zoom - The zoom that shows a whole image in a view of
rect_pxphysical pixels. - keys
- The keys, for a canvas with the keyboard (the caller says when): a
ladder step up or down, fit, 100 % and 200 % around the centre, and
with
arrowsthe arrows pan (Shift: further). Not during a pan. - pan
- A drag that pans (as the profile says, or with the pan key held): the image follows the pointer; Escape puts it back.
- pan_
key_ held - Whether the pan key is held over the canvas (a drag then pans, whatever is under the pointer).
- set_
canvas_ gestures - Sets the image canvases’ gestures in a context, over the pointer profile’s.
- slot
- A button’s place in
ViewGestures’ per-button tables. - view_
wheel - This pass’s wheel, scroll and pinch inputs as
gesturessay, in order; the wheel is taken from the panel around (call it only when the view is hovered). The one wheel path of the zoomable views. - wheel
- The wheel, a scroll and a pinch, raw, as the profile says: zoom around the pointer (holding at 100 % while the wheel goes on, unless free), or pan. Only while the canvas is hovered: the wheel is then taken from the panel around.
- wheel_
factor - The zoom factor of a wheel motion of
points(positive zooms in). - wheel_
step - What one input does with
gestures(view_wheel). - wheel_
zoom - The zoom after a wheel motion of
points(positive zooms in): a continuous factor that stops at exactly 100 % when it crosses it. - zoom_in
- The next ladder step above
zoom(orMAX_ZOOM’s step). - zoom_
out - The next ladder step below
zoom(or the smallest step).