Skip to main content

Module block

Module block 

Source

Structs§

BlockPaint
What a block’s body is painted from beyond its rect: the accent it strokes with, whether its interface is frozen, and whether it opens a scope.

Constants§

BOX_ROUNDING 🔒
Corner rounding of a block/port frame.
HATCH_SPACING 🔒
How far apart a conflict’s hatch lines run, in world px.
SHEET_INSET
How far inside its outline the second line of a scope-opening block runs. A quarter cell reads as its own line at a glance yet stays outboard of everything the block draws inside itself — the pin names start half a cell in, the size readout half a cell in from the left.

Functions§

draw_block_boundary
A block’s stroked boundary: its outline, plus — for a block that opens a scope — a second line inset within it, the classical contains-a-sheet notation. Every mode that draws a block body draws it through here, so the inset rides whatever stroke and fill that mode chose.
draw_block_frame
Draw a block’s body: the outline fill, then the title. Drawn before the block’s pins and labels so its opaque fill sits under them, never over them. The type label is left to the caller (it is block-only; ports/areas that share this frame have no type).
draw_block_title
draw_block_type
draw_block_type_placeholder
Faint “Add type” prompt at a block’s empty type slot. Like the tag placeholder, but suppressed on a locked block (whose type isn’t editable) — the caller gates that.
draw_box_outline
draw_refused_conflict
A conflict a move would create, hatched over the cells the two shapes would share. Only the overlaps that refuse the move are drawn: on a group move an overlap the selection already had refuses nothing, and marking it would claim a refusal that is not happening.
draw_size_readout
Draw a block’s size in grid cells inside its upper-left corner, where the pin gutter above the first slot leaves the one interior region no label occupies. Shown only while the block is being resized, on the rect the drop will commit. Returns the drawn extent.
draw_standing_conflict
A conflict the document already holds. Nothing refuses one — a paste has no overlap check, and the group rule exempts what a selection arrived with — but two shapes sharing cells is a routing fault the router has to work around, so it is marked until it is cleared.
hatch 🔒
45° hatching clipped to rect, as segments — the painter has no fill patterns, so the lines are clipped here rather than by a clip region.
size_label 🔒
A block rect’s size in whole grid cells, the way a document records it.