Skip to main content

Module ground

Module ground 

Source
Expand description

What lies under the diagram: the canvas fill and the grid over it.

One rule, read by every backend. The grid is not in the display list — it is drawn from the camera, so it stays sharp at any zoom and costs nothing to record — which would otherwise leave each backend to decide for itself where a line falls and how heavy it is.

Structs§

Ground
The two raw colours a backend paints the ground with. The app resolves these from its theme, so a backend never needs to know about roles.

Enums§

GridLine
The two weights the grid is drawn in.

Constants§

MAJOR_STEP 🔒
Every fourth grid line is a major one.
MIN_MINOR_SPACING 🔒
Screen-space spacing below which the minor grid lines are dropped, as they read as a wash of colour rather than a grid.

Functions§

along 🔒
World coordinates of the grid lines crossing span on one axis, each with its weight. Minor lines are skipped once they crowd together on screen.
horizontals
Screen y of every grid line crossing viewport horizontally, each with its weight.
screen 🔒
verticals
Screen x of every grid line crossing viewport vertically, each with its weight.