1 Commits

Author SHA1 Message Date
7369f62e92 Radius adjuster: Escape really cancels; steps stay round at round numbers
Two defects found by driving the adjuster through its own controls, rather than
calling setCircleRadius() directly as the first test did.

Escape applied the value it was meant to discard. Escape swaps the input back
out for the figure; removing a focused element fires blur synchronously while it
is still connected, and the blur handler commits — so the cancelled value was
applied a moment later. The input now settles exactly once.

A typed 200 stepped by 5 instead of 10. OpenLayers stores a circle as its centre
and a point on the edge and recomputes the radius as (cx + r) - cx, which at map
coordinates around -278,000 comes back about 2e-11 short. 200 read as
199.99999999997, fell below the 200 threshold in radiusStep(), and stepped by the
smaller increment — at exactly the round numbers officers are likely to type,
and in a way that varied with position. The ground radius is now rounded to the
micrometre where it is read, which removes the noise and nothing anyone can see.
The cosine correction itself was checked across 2000 latitudes spanning Ghana
and round-trips exactly; it was not the source.

Checked end to end at Wa: draw through the tool, type through the input, Enter,
Escape, both steppers, a tap on the adjuster not starting a new measurement, the
popup agreeing with the tooltip, dragging the popup, the close button, reopening,
and Clear. 19 of 19.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-17 11:11:26 +02:00