Skip to main content

Module replay

Module replay 

Source
Expand description

A display list, drawn.

[DrawOp]s arrive in screen space with every swatch resolved and every font at the size it is drawn, so replaying one is a translation into Canvas2D calls and nothing more. What a mark still needs from the host is its text engine β€” which is Glyphs, the same value the kernel was called with, so the diagram draws the layout the recorder measured β€” and its images, which the registry was handed the bytes for when they arrived in a hand-off.

StructsΒ§

Nib πŸ”’
What every text mark is drawn through: the context, the frame’s swatches and the typeface.
Run πŸ”’
What every text mark carries: the run, its face at screen size, its ink.

EnumsΒ§

Repaint
Whether the frame just drawn is the whole diagram, or whether something it named was not ready and another frame is owed once it is.

FunctionsΒ§

ink πŸ”’
Fill every glyph of laid, where place puts its pen and turned by angle.
outline_rect πŸ”’
A rect, rounded where the display list asks for it. roundRect is a recent addition to the API, so a browser without it falls back to arcs.
paint πŸ”’
Fill then outline the path already built on ctx. A transparent swatch is no fill, and a stroke with no width or no colour is no outline β€” the same two nothings the egui backend’s strokes collapse to.
polyline πŸ”’
replay
Draw draw_list onto ctx, in order, in CSS pixels.
rotated πŸ”’
A run rotated by angle about its own anchor point, with the run’s top left corner at pos β€” the placement epaint’s anchored text shape makes of the same two values, so both backends rotate a pin’s label alike.
rows πŸ”’
A run inside the rect the recorder measured for it: the rows the layout broke it into, each glyph at the pen the layout placed it at.
turn πŸ”’
The glyph matrix: font units (Y up) scaled to points and turned by angle.
turned πŸ”’
by turned by angle, clockwise on a screen whose y axis points down.