Skip to content

The five widgets the audit could not judge were not broken (#212) - #215

Merged
tannevaled merged 1 commit into
mainfrom
fix/hidpi-off-by-two
Aug 16, 2026
Merged

The five widgets the audit could not judge were not broken (#212)#215
tannevaled merged 1 commit into
mainfrom
fix/hidpi-off-by-two

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Closes #212.

Scale, RangeSlider, ColorChooser, ColorPicker and Agenda were left out of the metric-scale catalogue because their runs did not double. I wrote that up as "a scaled metric composed with an unscaled one-pixel something" and said it needed reading their Draw. It did — and the answer is that there is nothing wrong with them.

The edge of a rounded shape is one pixel of anti-aliased coverage at any scale, plus a border that does scale. So the overhead around a feature's interior is partly constant, and interior = size − 2*(AA + border) is 12 at one scale and 26–28 at twice it — never 24. What doubles is the whole feature:

1x runs: [1 71 1 1 12 1 1 71 1]   thumb = 1+1+12+1+1 = 16
2x runs: [1 143 2 28 2 143 1]     thumb = 2+28+2     = 32

Why the audit is not "fixed" to see this

Every merge policy that would let a run-length comparison see it also hides the defect it exists for. Merging slivers into their neighbour turns an unscaled one-pixel border into a rounding difference of two pixels in a run of three hundred — which is exactly the Card/Button defect this whole audit started from. I tried four policies; each traded one class for the other.

So the audit stays strict and blind to this one shape, and the five get the assertion that suits them: TestRoundedThumbDoubles measures the thumb's whole extent, edges included, and requires it to double. An exemption nobody checks would have been the wrong answer to the same question.

🤖 Generated with Claude Code

Scale, RangeSlider, ColorChooser, ColorPicker and Agenda were left out of the
metric-scale catalogue because their runs did not double. I wrote that up as "a
scaled metric composed with an unscaled one-pixel something" and said it needed
reading their Draw. It did, and the answer is that there is nothing wrong with
them.

The edge of a rounded shape is one pixel of anti-aliased coverage at ANY scale,
plus a border that does scale. So the overhead around a feature's interior is
partly constant, and interior = size - 2*(AA + border) is 12 at one scale and 26
to 28 at twice it -- never 24. What doubles is the WHOLE feature:

    1x runs: [1 71 1 1 12 1 1 71 1]   thumb = 1+1+12+1+1 = 16
    2x runs: [1 143 2 28 2 143 1]     thumb = 2+28+2     = 32

Every merge policy that would let the run-length audit see this also hides the
defect it exists for: merging the slivers into their neighbour turns an unscaled
one-pixel border into a rounding difference of two pixels in a run of three
hundred. I tried four of them.

So the audit stays strict and blind to this one shape, and the five get the
assertion that suits them: the thumb's whole extent, edges included, doubles.
An exemption nobody checks would have been the wrong answer to the same
question.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit 37ad43f into main Aug 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scale and ColorChooser scale by two device pixels too many

1 participant