Expand description
The ruler’s arithmetic, without egui: which steps its ticks and labels take at a zoom, where they go, and what snapping lands on.
Structs§
- Mark
- A tick of the ruler.
- Snap
Targets - Points a time is pulled to, with what each is.
- Ticks
- The ruler’s steps at a zoom, in seconds: a label at each major tick, a short tick at each minor one (the grid snapping lands on).
Enums§
- Snapped
- What a time snapped to.
Constants§
- LABEL_
GAP - The room kept between two labels, in points.
- LABEL_
INSET - Where a label starts after its tick, in points.
- MIN_
TICK_ GAP - The least room between two minor ticks, in points.
Functions§
- marks
- The ticks in view and their labels.
- snap
timesnapped: to the nearest point withinreachseconds, else to the grid when there is one, else onto the scale’s units.- snap_
span - Where a span
lengthlong starting nearstartsnaps: whichever of its edges is nearer a point withinreachlands on it; otherwise its start goes onto the grid (or the scale’s units). Its new start, and what it snapped to. - ticks
- The steps the ruler takes for
viewacrosswidthpoints: the finest whose labels, measured bymeasure(their width in points), never overlap; and under it the finest grid that divides it and keepsMIN_TICK_GAP.