Skip to content

Conversation

@askadityapandey
Copy link

This PR updates scrollbar painting to use a fixed device-pixel
thickness for the gutter and thumb so the UI looks consistent
across different zoom levels and DPI scales.

Key changes

  • Introduces fixed device-pixel thickness for scrollbar chrome.
  • Converts that thickness to CSS pixels using device_pixels_per_css_pixel().
  • Adjusts gutter/thumb rects so right/bottom edges remain anchored.
  • Only affects PaintPhase::Overlay and elements whose scrollbar is not none.

Notes

  • Visual-only sizing change; scrolling behaviour is unchanged.
  • If wanted, this can be exposed via CSS scrollbar-width later.

Fixes #6920

Make scrollbar gutter and thumb use a fixed device-pixel thickness
so their visual size stays consistent across DPI and zoom levels.

Anchor the right/bottom edges when adjusting the rects to avoid
visual drift. This keeps scrollbar chrome stable at different
device_pixel_ratio values and avoids layout shifts.
@ladybird-bot
Copy link
Collaborator

Hello!

One or more of the commit messages in this PR do not match the Ladybird code submission policy, please check the lint_commits CI job for more details on which commits were flagged and why.
Please do not close this PR and open another, instead modify your commit message(s) with git commit --amend and force push those changes to update this PR.

@konradekk
Copy link
Contributor

(note: there's scrollbar-width checked above, it can contain thin value. looks like a short stretch to add that here, while you are at this.)

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.

Zooming the page changes scrollbar sizes

3 participants