Expand description
The canvas world→screen scale, constrained to the range the view ever
legitimately reaches: framing clamps to [0.1, 10] and wheel zoom to a
narrower band inside it. The type guarantees the scale is positive, so
screen↔world division is always sound.
Structs§
- Factor
- What a zoom is multiplied by: a wheel notch, a pinch, a keyboard step. Above one magnifies.
- Scroll
Px - A wheel notch as a host reports it: the screen pixels the diagram was asked to scroll up by. Hosts disagree on the sign of a wheel, so each states its own in this type’s terms and none of them states the rate.
- Zoom
- A newtype rather than a
Bounded<ZoomBounds>alias soZoom::unitycan be inherent; the clamping and the total order areBounded’s. - Zoom
Bounds
Enums§
- Zoom
Step - One keyboard zoom step’s direction — the parameter form of “which way”,
so a call site reads
ZoomStep::Inrather than a bare sign or factor.
Constants§
- SCROLL_
ZOOM_ 🔒RATE - Zoom factor exponent per pixel of scroll. One rate, so a wheel notch means the same thing whichever host read it.