mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-25 02:07:09 -06:00
Zooming in on an inch ruler stepped through 0.2, 0.1 and 0.05 of an inch: `Unit::ruler_step` picked from one decimal ladder for every unit, and the rulers divided whatever it returned by ten. A tenth of an inch is not a mark an inch ruler carries (#2827). Below an inch the steps are binary fractions now, 1/2 down to 1/128, and `Unit::ruler_minor` gives the unlabelled ticks between two labels: an eighth of the step on an inch ruler, so every tick is a binary fraction of an inch and they stay about as dense as the tenths elsewhere. An inch and wider keeps the shared ladder, and the metric units, points, pixels and picas keep their tenths. Ruler-tick snapping follows the ticks that are drawn, which moves an inch document's Shift-drag of a guide onto the same grid. `ruler_label` took its decimals from `(-step.log10()).ceil()`, which writes 1/16 as "0.06" and 1/8 as "0.13" -- wrong values, not just rounded ones. It uses the fewest decimals that write the step exactly, and drops trailing zeros as `Unit::number` does, so a sixteenth-inch ruler labels the inch `1` rather than spelling `1.0000` down six lines of the vertical ruler.