Repository navigation
Text in a scrolling list moves in whole pixels with its box - #1147
Merged
Merged
Conversation
… what text lays out against
…ow is: the stack's offset is not what text lays out against either
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
…and a page's band) is a scroll's kind of translation; Inherit::shift goes
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.
While a list follows its end as a reply grows or a prompt arrives, text no longer drifts against its row by fractions of a pixel. This is the last part of the jitter request after #1072 (text under a folding or growing row) and #1067 (growth stepped by each frame's time).
Cause: a box under a scroll draws at
round(rigid): the scroll and every translation above it, rounded as one. A text inside lays out from its exact place againstInherit::steady, andsteadystill held the scroll's offset and the growth stack's window offset. Every frame the end-follow moved the scroll by a fraction, so the text moved by that fraction while its row moved in whole pixels: up to 0.9 px apart.Change (
runtime/paint/pixel_snap.rs,runtime/paint/build.rs,runtime/web/page.rs; head16854238):rigidonly, notsteady: a scroll's drawn offset, a sticky shift, a web page's band (Inherit::scroll), and a growth offset, a row's or a stack's window's (Inherit::grow).Inherit::shift, which moved both, is gone.rigidholds still. Before this fix (the first head,1a5b8e24),steadytook the shift alone, which follows the scroll's fraction, so the header's text drifted up to a pixel every frame of a glide. The independent read found it; the header's runs are below.steadykeeps the paint containments' origins only. An overlay starts it again at zero.Kit's growth-stack motions (Rune's
growth_reorder, headless at 120 fps, the probe's glyph origin against its drawn box per painted frame; frames where a label moves ≥ 0.25 px against its row):dev842c28c2(1x / 1.5x / 1.875x)grp_boxes.py).The app's own timeline (desktop
devon Rune10a39584, with and without #1147's commits, both with the text probe; fixture session A headless at 120 fps, 240 frames; frames where any text moves ≥ 0.25 px against its own box):at[1].round()). The list item goes from baseline 205.9375 (drawn at 206) over box 176, to 228.4375 (drawn at 228) over box 198: 30 px both times. The trigger goes from 212.4375 (212) over 188, to 228.9375 (229) over 205: 24 px both times. The 0.5 px is the text's fraction against its box crossing a half pixel, not the scroll tie. A run that keeps the frames lost them to a script fault, so the ink is not compared.page.rssnap_band:(y * s).round() / s), so it can't sit on a fractional device pixel. The page's band now movesrigidonly, like a scroller's offset; on a whole-pixel value that changes no text's place. No web capture was run.At rest, against official (the layout-cards sweep: 22 timeline screens × light and dark; pixels more than two levels from every official pixel within one device pixel):
session-markdown,session-md-blocks,session-menu)session-edit-expanded)session-markdown,session-menu: −7 to −29 px), 4 farther (session-edit-expanded+38 and +10 of 29,211 and 27,176;session-md-blocks+14 and +14 of 202,716 and 183,932)Four 1.875x screens move away from official because text now takes the rows' half-pixel tie. They sit on a half-pixel scroll offset. Rune rounds the combined translation with
(v + 0.5).floor(), so −687.5 px becomes −687, where Chromium rounds the positive offset half up (+688). Text now rounds with its rows, so it takes Rune's tie too. That tie is its own follow-up PR: round the scroll offset half up in device pixels before it is negated, checked at every scroller's end at 1x to 2x against official. This PR doesn't change how rows round.Mac at
16854238a502b4d70dc7a74bd06c1cb3013ddfa1: 3,088 passed, 1 failed, the known order-dependentruntime::tests::scroll_children::scroll_xy_with_direct_children_scrolls_both_axes_and_warns_on_trailing_growth_sibling, as ondev. Windows: PROOF-FARM's lane has this head. No test added.