Skip to content

Scale and ColorChooser scale by two device pixels too many #212

Description

@tannevaled

Both are out of the HiDPI audit catalogue (#211) for the same reason, and it is worth chasing separately because it is a different class from the one the audit was built for.

Everything fixed so far looked like 12 at 1x, 12 at 2x — a metric that ignores the scale entirely. These two look like:

ColorChooser  column at 0.50: run 0 is 12 at 1x and 26 at 2x, want ~24
Scale         row    at 0.50: run 1 is 12 at 1x and 28 at 2x, want ~24

Off by two and four device pixels. That is a scaled metric composed with an unscaled one-pixel something — a border that thickened next to a pad that scaled, or a /2 that rounds the other way at twice the size — and it needs reading their Draw rather than widening a tolerance, which would then hide the class the audit does catch.

To reproduce: put them back in the catalogue in metricscale_audit_test.go

{"Scale", 160, 24, func() Widget { return &Scale{Min: 0, Max: 1, Value: 0.5} }},
{"ColorChooser", 160, 120, func() Widget { return NewColorChooser(RGB(0x40, 0x80, 0xC0)) }},

and run go test -run TestMetricScaleAudit.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions