Skip to main content

Module edit

Module edit 

Source
Expand description

The in-place editor as the kernel asks for it and the front end answers.

The editor is the front end’s: it runs a visible text field of its own over the diagram, keeps the draft, the caret and the selection, and says only how the edit ended. The kernel hears no keystroke and leaves out of the diagram the text the field covers, so what the editor lays out may differ from what is committed — a rotated label edited upright, a text box wrapped where the editor wraps — until the commit lays it out again.

Structs§

EditField
The editor as the front end shows it: where its field sits on screen, what the field opens on, and how it is drawn. font and wrap_width are in world units, scaled by the vantage the view was painted under, like the request they came from.

Enums§

TextEvent
How the front end’s editor ended the edit on field id.
TextOutcome
How the editor a tool opened ended, as the tool reads it off the frame’s Interaction: the one way the edited text reaches a tool, so a tool cannot read a stale draft.

Constants§

EDITOR_AREA_COLUMNS
The smallest a multi-line field opens at, in columns and lines of its own font: a text box is written in a text area, not in a one-line slot.
EDITOR_AREA_LINES
EDITOR_BORDER
The width of the ring round a field.
EDITOR_MIN_WIDTH
The narrowest a field is, so a short or empty one is still a place to type.
EDITOR_PAD
The air between a field’s ring and its text.
EDITOR_ROUNDING