Skip to main content

Module text

Module text 

Source

Constants§

ADD_NAME_PLACEHOLDER
Placeholder text shown faint at an empty editor or label slot to prompt input. The pin name/type prompts also appear as a faint static overlay when the pin’s shape is selected (see draw_label_placeholders).
ADD_ROUTE_LABEL_PLACEHOLDER
ADD_TAG_PLACEHOLDER
Short prompt for the compact tag editors (pin tag, block tag).
ADD_TEXT_PLACEHOLDER
ADD_TITLE_PLACEHOLDER
ADD_TYPE_PLACEHOLDER

Functions§

draw_label_placeholders
Draw faint “Add Name”/“Add Type” prompts at a pin’s empty label slots, in the same positions draw_pin_labels would use. Called only while the pin’s shape is selected, so the user sees where to double-click to add a label.
draw_pin_labels
Draw a pin/port’s name (centered on pos, in pin_font) and type_label (centered one grid below, in the smaller pin_subtitle_font). h_align is the horizontal alignment (RIGHT for East, LEFT for West, CENTER for ports). Empty labels draw nothing.
draw_tag_placeholder
Draw the faint “+tag” prompt where an empty (but shown) pin/port tag would sit — outboard over the stub, placed by pin_tag_location. left/right are the shape’s edge x-coordinates, side the side the label hangs off, and line_y the stub’s y. Only drawn when the tag is shown; an empty hidden tag stays invisible.
first_line
A pin/port label’s first line. Name and type are single-line, but a document may carry a trailing \n-separated line in name; this drops it.
pin_label_anchors
The two draw anchors for a pin’s labels, both vertically centered: the name on pos (the pin’s stub), and the type one GRID_SIZE below — nudged up by TYPE_SHIM_Y. Content-independent, so the render, placeholder, and hit-test paths place both lines identically. Returns (name_pos, type_pos).