diff-edit: Simplify scrollbar visibility

This commit is contained in:
Andrew Hamilton 2022-01-21 09:02:05 +10:00
parent 244dc5897d
commit 4ea09b9ab8

View file

@ -281,8 +281,8 @@ class View:
if full_width == 0 or full_height == 0:
return self.portal.appearance_for(dimensions)
x, y = self.portal.position
hide_scrollbar_vertical = self.hide_scrollbars and full_height <= height and y == 0
hide_scrollbar_horizontal = self.hide_scrollbars and full_width <= width and x == 0
hide_scrollbar_vertical = self.hide_scrollbars and full_height <= height
hide_scrollbar_horizontal = self.hide_scrollbars and full_width <= width
if not hide_scrollbar_horizontal:
full_width = max(full_width, x + width)
self.horizontal_scrollbar.interval = (x / full_width, (x + width) / full_width)