Repository navigation
Conversation
…wn whole a box sized to exactly its label, as a tab or a fit-width button builds it, is formed from absolute coordinates, and far from the left edge their rounding leaves it a hair narrower than the label, which fit_box then cut with an ellipsis. the comparison is of float pixel widths, so it now allows FIT_SLACK, a sixty-fourth of a pixel. the test draws labels in boxes sized to them at offsets from 900 to over 5000 and fails without the fix.
a tab's body is drawn short of the separator after it (the tab style's margin.r), but the strip measured and laid tabs out by their body width alone, so every unshrunk tab's body came out one separator narrower than its label and fit_box cut the label with an ellipsis. the strip now measures, scrolls and places tabs by their room, the body and the separator, read once into the bar's geometry. the test checks each roomy tab is drawn its whole natural width, and fails with the old layout.
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.
Closes #198
Two causes, both pinned by tests that fail without their fix:
tab.margin.r), but the strip laid tabs out by body width alone, so every roomy tab's body was 1 px narrower than its label. A newroom()(body plus separator, read once into the bar'sGeom) is what the strip measures, scrolls and places by.natural,leastandwidthstay body widths, so fix: unshrunk tabs cut their labels with an ellipsis #194's test still holds. Test:bar__a_tab_with_room_is_drawn_its_whole_width, which fails with the old layout.fit_boxnow allowsFIT_SLACK, a sixty-fourth of a pixel. Test:text__a_label_sized_to_its_box_is_whole_anywheresweeps offsets from 900 to over 5000, and fails with the exact comparison.Found by instrumenting octalide/ac's docked tab strips: each tab's natural width was 57.34 while its drawn rect was 56.34, with 18 px of empty tab after the ellipsis. With this branch the ac monitor's tabs read in full.
Ran
mach test .(229 pass),mach fmt --check ., and the gallery and panel demo tests aftermach dep pull. The goldens are unchanged.