Revert "fill3: Cope with negative interval fractions in scrollbars"

This reverts commit b9455f393d.

- Fixed the bug properly in diff-edit.
This commit is contained in:
Andrew Hamilton 2022-03-15 13:01:38 +10:00
parent 51700abd3a
commit 0da0d92585

View file

@ -185,10 +185,9 @@ class ScrollBar:
width, height = dimensions
assert width == 1 or height == 1, (width, height)
length = width if self._is_horizontal else height
interval = [abs(fraction) for fraction in self.interval]
assert all(0 <= fraction <= 1 for fraction in interval), interval
assert all(0 <= fraction <= 1 for fraction in self.interval), self.interval
(start_index, start_remainder), (end_index, end_remainder) = \
[divmod(fraction * length * 8, 8) for fraction in interval]
[divmod(fraction * length * 8, 8) for fraction in self.interval]
start_index, end_index = int(start_index), int(end_index)
start_remainder, end_remainder = int(start_remainder), int(end_remainder)
if start_index == end_index: