Skip to content

fix: pixel-snap tab-bar border lines so they don't randomly disappear#1682

Open
cantona wants to merge 4 commits into
raphamorim:mainfrom
cantona:fix/tab-bar-border-pixel-snap
Open

fix: pixel-snap tab-bar border lines so they don't randomly disappear#1682
cantona wants to merge 4 commits into
raphamorim:mainfrom
cantona:fix/tab-bar-border-pixel-snap

Conversation

@cantona

@cantona cantona commented Jun 25, 2026

Copy link
Copy Markdown

The vertical tab separators and the inactive-tab / left-margin bottom borders were drawn 0.5 logical px thick at fractional positions. sugarloaf.rect scales logical coords by scale_factor without rounding, so these thin lines landed between physical pixels and the rasterizer dropped them — a window resize shifted positions enough to occasionally realign them (the classic 'separator missing, reappears on resize'). Snap each line's position to a whole physical pixel and use a 1-physical-px thickness so they always render.

Note: this branch is stacked on the tab-font-size (#1681) and tab-bar-height work, so it includes those commits; the border-fix commit is the last one. Happy to rebase onto main once those land.

cantona and others added 4 commits June 25, 2026 15:54
The tab-strip title size was hardcoded to TITLE_FONT_SIZE = 12.0. Add a
`tab-font-size` option under [navigation] (default 12) threaded into the
Island renderer, and apply it on config hot-reload alongside the tab
colors.
The tab/navigation bar height was a hardcoded ISLAND_HEIGHT const (34px).
Replace it with a navigation.tab-bar-height config option (default 34)
plumbed through to the Island and the hit-test sites, so the tab bar can
be resized. Mirrors the existing navigation.tab-font-size option.
The vertical tab separators and the inactive-tab / left-margin bottom
borders were drawn 0.5 logical px thick at fractional positions.
sugarloaf.rect scales logical coords by scale_factor without rounding,
so these thin lines landed between physical pixels and the rasterizer
dropped them; a resize shifted positions enough to occasionally realign
them (hence 'missing, reappears on resize'). Snap each line's position
to a whole physical pixel and use a 1-physical-px thickness so they
always render.
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