Skip to main content

Module pin

Module pin 

Source

Structs§

PinPaint
One pin’s per-draw adjustments: the drag shift, a forced side, and the resolved stub accent (derived from route roles, never stored on the pin).

Constants§

FRAME_HALF_STROKE 🔒
Half the block/port outline stroke width: a pin stub’s block-side endpoint sits this far outside the bbox edge so it butts against the outline’s outer face. The outline is centered on the edge (StrokeKind::Middle), so its outer surface lies half a stroke-width out; stopping the stub there makes a clean butt-joint instead of letting it run across the outline.
PIN_ARROW_HALF_W 🔒
Half-width of a pin/port arrowhead base, in world units.
PIN_ARROW_LEN 🔒
Length of a pin/port arrowhead along the stub, in world units.

Functions§

draw_arrowhead 🔒
Draw a filled triangular arrowhead with its point at head, pointing in dir.
draw_pin
Draw a pin: its stub (in paint.accent, else PinStem), its name, and its tag.
draw_pin_placeholders
Draw the faint “Add Name”/“Add Type”/“+tag” prompts for one block pin’s empty label slots — used by the selected-block render so empty fields are discoverable. The “+tag” prompt is only drawn for a shown (not hidden) tag.
draw_pin_stub
Draw a pin/port stub from edge (the outline’s outer face — see pin_stub_endpoints) out to tip, with an arrowhead flush against the shape so input and output pins read symmetrically:
pin_stub_endpoints 🔒
The pin stub’s two endpoints: a on the outline’s outer face (FRAME_HALF_STROKE outside the bbox edge, so the stub butts against it), b one cell outward. side is the (possibly overridden) side and delta_y shifts it during a drag preview.
render_pins_with_box