Skip to main content

Module draw

Module draw 

Source
Expand description

Drawing helpers on GlyphBuffer that skins repeat: a panel with a title set into its top border, a meter bar that shows how full something is, a line print_centred in a rectangle and a line print_cut to a width (with cut, the text it prints).

Each counts cells as GlyphBuffer::print does: one a char, two a wide one (GlyphBuffer::widths).

Structs§

PanelLook
How a GlyphBuffer::panel looks: its border’s style and colour, its title’s colour, and the text colour and background it is cleared to.

Functions§

cut
text in at most w cells, measured with widths: cut, its last cell a …, if it is longer. A wide character that would reach that cell goes too.
meter_fill
How many of a meter’s cells are full when it shows filled of of.