Skip to main content

Module selection_handles

Module selection_handles 

Expand description

Selection handles for a canvas: the frame around what is selected, its resize handles at the corners and (once the frame is big enough on screen, or always with SelectionHandles::with_edges) at the middle of each edge, and its rotation handle above (unless SelectionHandles::without_rotation: a crop, a text box, a clip), drawn in your colour and hit-tested at a constant size on screen whatever the zoom.

The frame may be turned (a rotated shape keeps a frame along its own sides), and every drag is answered in the frame’s own axes.

The frame owns no document state. A canvas keeps its selection, asks SelectionHandles::handle_at what a press landed on, and turns the drag into its own action with SelectionHandles::stretch_for or SelectionHandles::rotation_for, so every edit still goes through the canvas’s published vocabulary.

Structs§

SelectionHandles
The frame around a selection, in content coordinates: bounds turned by angle about its centre.
TextGrips
The grips of a text selection on a touchscreen: at its start a stem down the first selected line’s leading edge with a knob above it, at its end a stem down the last line’s trailing edge with a knob below, in the selection’s accent. A finger drags either end; the knobs are hit at a constant target on screen whatever the zoom.

Enums§

Handle
A grip on the selection frame.
TextGrip
One end of a text selection a finger can take.
ToolFeedback
Feedback over authored canvas content. The contrasting under-stroke keeps a brush footprint or erased boundary visible over either light or dark paint.