Expand description
The canvas in use, and the navigation commands sent to it.
Experimental: may change in any release
(docs/stability.md).
A canvas (the node graph, the image viewport, a plot) marks itself
active each frame the pointer is over it or it has the keyboard
(mark_active). The application’s view.* commands
(view.fit, view.frame_selection, view.zoom_in, …) go to the
active canvas through request, and the canvas takes them at its
next frame (take); the canvasActive context key says whether
one is active, so the commands’ keys reach nothing else. A canvas
publishes its zoom (set_zoom) for a zoom control to show; hand
mode (hand) is shared by every canvas. The navigation model
itself is the viewport crate’s (egui_pop_viewport::navigation).
Functions§
- active
- The canvas in use: one marked this frame or the one before.
- hand
- Whether hand mode is on: a primary drag pans every canvas (for a pen,
a touch screen or a mouse without a middle button).
view.handtoggles it on whichever canvas takes it. - last
- The canvas marked last, however long ago (where an agent’s command goes when no canvas is in use).
- mark_
active - Marks a canvas as the one in use this frame (the pointer is over it, or it has the keyboard).
- request
- Sends a navigation command (
view.fit, …) to the canvas in use, else to the one marked last. Whether there was one. - request_
to - Sends a navigation command to a canvas by its id.
- set_
hand - Turns hand mode on or off.
- set_
zoom - Publishes a canvas’s zoom (1 is 100 %: one content unit, or one image pixel, to a point), each frame it draws.
- take
- The commands waiting for a canvas, taken.
- zoom
- A canvas’s zoom as it last published it.