Expand description
The free-slot markers: where a pin can be added to a block.
Every free pin slot on a block is offered as a small blue dot one grid cell
outside the block edge — where the pin’s connection point will land. The
dot nearest the cursor animates into a blue ring that grows out to
PORT_RADIUS.
Three tools offer them: a selected block offers its own (the “(+)”), the add-pin tool offers every block’s in scope, and the route tool offers the nearest block’s so a route can end on a pin that does not exist yet. Which blocks offer, where a marker sits, which one a press lands on and how one is drawn are decided here, once.
Structs§
- Slot
Marker - One free slot’s marker: the block a pin would be added to, the slot, and the world point the new pin’s connection will sit at.
Constants§
- NEW_
PIN_ 🔒ACTIVATION_ RANGE - How near the cursor must be for a marker’s resting dot to appear.
- 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).
Functions§
- active_
marker 🔒 - The marker nearest
poswithinNEW_PIN_ACTIVATION_RANGE, if any. At most one is ever active, so the markers never fight over the cursor. - add_pin 🔒
- Add the pin
markeroffers and open its name for editing.Nonewhen the block declines it, as a block locked since the marker was drawn does. - anim_
key 🔒 - The animation key for one marker, keyed by block, side and slot so each
marker animates independently.
tagkeeps one tool’s animation apart from another’s. - clearances 🔒
- What each affordance around a free slot’s marker leaves it: how big the marker’s disc may grow before it touches that neighbour’s own.
- draw_
marker 🔒 - One marker
tof the way through growing: the resting dot fades out as the ring and its+grow in, so it reads as the dot expanding into the ring. - draw_
markers 🔒 - Draw
markersas buttons: the one nearest the hover grows its ring, and the one a press holds down is drawn inverted — a filled disk with a light+— and locks out the hover. - draw_
plus 🔒 - A
+glyph centered atcenter, sized to the marker radius. - draw_
route_ 🔒markers - Draw the route tool’s markers and return the one armed — grown to the
full control — if any. A marker’s resting dot appears once the pointer is
within
NEW_PIN_ACTIVATION_RANGE; the nearest grows into the ring once the pointer is withinNEW_PIN_GROW_RANGE. - marker_
at - The marker a press at
poslands on: the active one, within the widest grab its neighbours leave it — wider than the ring draws at, like every other target on the canvas. - markers_
in_ scope - The markers every block in the current scope offers.
- markers_
on - Every free slot’s marker on
block, whether or not the block offers them. - nearest_
block_ 🔒markers - The block whose markers the route tool shows with the pointer at
pos: the one owning the nearest marker in range, so the cursor is never crowded by several blocks’ markers. - new_
pin_ 🔒grab - How near the pointer must come to a free slot’s marker for a press to place a pin there.
- offered_
markers - The markers
blocksoffer. A block offers none when nothing may be added to it — a locked interface and a read-only session both mean that.