Skip to main content

Module selection

Module selection 

Source

Constants§

HANDLE_GRAB
How near its corner a press grabs a resize handle: twice the radius the handle draws at, on every resizable shape.
HANDLE_RADIUS
The radius a grown resize handle draws at, and the armed one.
LOCK_HINT_SVG 🔒
The padlock icon drawn as the locked-block corner hint. The same asset backs the overlay lock button, so the hint and the button stay identical.
NEW_PIN_ANIM_TIME
Grow time for a handle’s activation transition.
NEW_PIN_GROW_RANGE
How near the cursor must be for a marker to grow into the full control. The resize tool activates on the resting-dot range; the route tool grows the control only this close so the dot reads as a target before it arms.
NEW_PIN_INACTIVE_SCALE
Resting dot radius as a fraction of PORT_RADIUS (a small, unobtrusive marker).
RESIZE_INACTIVE_SCALE
Resting size of a resize handle, as a fraction of HANDLE_RADIUS. A corner handle is a coarser target than a route/new-pin anchor, so it rests 30% larger than NEW_PIN_INACTIVE_SCALE to stay easy to spot and grab.

Functions§

anim_key 🔒
The animation key for one corner handle. Keyed on the corner’s snapped position so a settled selection’s handles animate independently and stably; the resize-active corner draws armed (not animated), so its position churning during a drag never feeds a key.
draw_armed_handle 🔒
Draw the inverted “armed” handle: a filled disk acknowledging the press, used for the corner currently being resized.
draw_corner_handle 🔒
Draw one corner handle at growth t: a resting dot fading out as the full HANDLE_RADIUS ring grows in, so it reads as the dot expanding into the handle.
draw_lock_hint
Draw the padlock hint in a selected locked block’s upper-right corner: a passive sign that the block is locked, not a button. Renders the lock action icon’s SVG tinted to Role::LockedHintIcon so it reads as dim and stays identical to the overlay lock button. Sits clear of the top-right resize handle and is skipped when the block is too small to hold it without crowding.
draw_selection_frame
Draw the four corner resize handles for bbox. Each handle rests as a small dot and grows into the full handle as the pointer approaches, exactly like the route/new-pin anchor targets. When mode is set, that corner is being resized and draws armed (an inverted filled disk) as click-success feedback.
grown 🔒
How grown one corner’s handle is this frame: eased toward full size as pointer nears it (within NEW_PIN_GROW_RANGE), mirroring the route and new-pin anchor targets.
resize_handle_at
The handle a press at pos grabs on a selection framing bbox.
resize_handles
The four corner handles of a selection framing bbox, each with the resize it starts.