Skip to content

toolkit: a bar is not a dot, and DrawIconDot cannot draw one - #441

Merged
tannevaled merged 1 commit into
mainfrom
a-bar-is-not-a-dot
Aug 31, 2026
Merged

toolkit: a bar is not a dot, and DrawIconDot cannot draw one#441
tannevaled merged 1 commit into
mainfrom
a-bar-is-not-a-dot

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

DrawIconDot insets its box by at least two pixels on every side. That is right for a dot — it keeps it off whatever it sits on — and fatal for a bar: a four-pixel-tall box comes back empty, silently, because the inset ate it.

It cost a menu-bar icon that drew nothing where a light was meant to be, and looked like a colour problem for ten minutes.

DrawIconBar fills the rectangle as given, with ends rounded to half the shorter side. A caller asking for a bar has already chosen its thickness, and taking two pixels off each side of that is taking away the decision.

The test asserts the thickness that comes back is the thickness that was asked for — at two, three, four and eight pixels — and then draws the same box through DrawIconDot and requires it to draw nothing, so the reason this exists cannot quietly stop being true. Corners of the bounding box are checked empty: a lit line, not a filled box.

Coverage stays at 100.0%.

DrawIconDot insets its box by at least two pixels on every side. That is
right for a dot -- it keeps it off whatever it sits on -- and fatal for a
bar: a four-pixel-tall box comes back EMPTY, silently, because the inset
ate it. It cost a menu-bar icon that drew nothing where a light was
meant to be, and looked like a colour problem for ten minutes.

DrawIconBar fills the rectangle AS GIVEN, ends rounded to half the
shorter side. A caller asking for a bar has already chosen its
thickness, and taking two pixels off each side of that is taking away
the decision.

The test asserts the thickness that comes back is the thickness that was
asked for, at two, three, four and eight pixels -- and then draws the
same box through DrawIconDot and requires it to draw NOTHING, so the
reason this exists cannot quietly stop being true.
@tannevaled
tannevaled merged commit 164e07c into main Aug 31, 2026
1 check passed
@tannevaled
tannevaled deleted the a-bar-is-not-a-dot branch August 31, 2026 20:25
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.

1 participant