Skip to content

Fix: ScrollArea layout jitter with floating bars and zoom levels#7944

Open
rustbasic wants to merge 3 commits intoemilk:mainfrom
rustbasic:patch174
Open

Fix: ScrollArea layout jitter with floating bars and zoom levels#7944
rustbasic wants to merge 3 commits intoemilk:mainfrom
rustbasic:patch174

Conversation

@rustbasic
Copy link
Contributor

Fix: ScrollArea layout jitter with floating bars and zoom levels

This PR improves the stability of ScrollArea by addressing two layout issues:

  1. Discrete Layout for Floating Bars: Fixed content "shaking" in floating mode when a non-zero allocated_width is used. By using discrete visibility (show_bars) instead of the animated factor for space allocation, we ensure the layout remains stable during scrollbar animations.
  2. Zoom-level Stability: Introduced a small epsilon (0.1) when checking if content exceeds the viewport. This prevents scrollbars from flickering on and off due to floating-point rounding errors at specific zoom factors (e.g., 1.01 or 0.95).

@github-actions
Copy link

github-actions bot commented Mar 1, 2026

Preview available at https://egui-pr-preview.github.io/pr/7944-patch174
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

View snapshot changes at kitdiff

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.

Unstable available_size in CentralPanel

1 participant