fix: pixel-snap tab-bar border lines so they don't randomly disappear#1682
Open
cantona wants to merge 4 commits into
Open
fix: pixel-snap tab-bar border lines so they don't randomly disappear#1682cantona wants to merge 4 commits into
cantona wants to merge 4 commits into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The vertical tab separators and the inactive-tab / left-margin bottom borders were drawn 0.5 logical px thick at fractional positions.
sugarloaf.rectscales logical coords byscale_factorwithout 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.