fix scrollbar thumb height

This commit is contained in:
Will McGugan
2023-03-23 20:59:44 +00:00
parent 11cf1f1d28
commit 1e4dd1cee4
3 changed files with 7 additions and 4 deletions

View File

@@ -112,10 +112,6 @@ class ScrollBarRender:
thumb_size = window_size / step_size * len_bars
if thumb_size < len_bars:
virtual_size += step_size
step_size = virtual_size / size
start = int(position / step_size * len_bars)
end = start + max(len_bars, ceil(thumb_size))

View File

@@ -2664,6 +2664,7 @@ class Widget(DOMNode):
self._check_refresh()
def _check_refresh(self) -> None:
"""Check if a refresh was requested."""
if self._parent is not None and not self._closing:
try:
screen = self.screen

View File

@@ -334,3 +334,9 @@ def test_tabs_invalidate(snap_compare):
SNAPSHOT_APPS_DIR / "tabs_invalidate.py",
press=["tab", "right"],
)
def test_scrollbar_thumb_height(snap_compare):
assert snap_compare(
SNAPSHOT_APPS_DIR / "scrollbar_thumb_height.py",
)