Skip to main content

Module route_start

Module route_start 

Source
Expand description

Route-start / route-end hover targets.

In the select tool, the pin/anchor nearest the cursor grows a green dot at its stub end out to a PORT_RADIUS ring; pressing it inverts the ring, and a click or a drag starts a route anchored there (handing off to the route tool in its return-to-select mode). The route tool reuses draw_anchor_target to put the same growing target on the pin that will end a route in progress.

Enums§

Grab 🔒
Draw the green grow-out target at center. The resting dot grows to a PORT_RADIUS ring as pointer nears it (within NEW_PIN_GROW_RANGE); when pressed it is drawn inverted, as a filled disk. Whether the pointer is currently holding the target down.

Functions§

anim_key 🔒
The animation key for an anchor’s target, tagged distinctly from the new-pin keys.
draw_anchor_target 🔒
draw_nearest_anchor_target 🔒
Draw the grow-out target on the anchor nearest pointer (skipping exclude), returning it if one is in range. Shared by the select tool’s route-start and the route tool’s hover/end targets so they animate identically.
grab_radius 🔒
How near a press must land to grab an anchor. A cursor aims at the drawn ring, having watched it grow out under the pointer, so PORT_RADIUS is exactly what it is aiming at. A fingertip has no hover phase to aim by and covers several times that, so touch grabs anywhere the ring would have grown — the region the cursor only gets to see is armed.
nearest_anchor_target 🔒
The nearest pin/anchor to pointer within NEW_PIN_ACTIVATION_RANGE, paired with its stub-end point. exclude skips one anchor (a route’s start, which can’t also be its end).
start_route 🔒
target_at 🔒
The anchor target pos lands on: the nearest one, within grab of it.
widget 🔒
Select-tool entry. Renders the route-start target on the nearest anchor and, on a click or drag of it, hands off to the route tool. Break means the pass owns this frame’s interaction (carrying the tool switch, if the gesture produced one); Continue falls through to the caller’s own handling.