Avoid redundant max in absolute_offset_reversed

I believe `Offset::absolute` guarantees the offset never exceeds the
maximum scrolling boundaries already.
This commit is contained in:
Héctor Ramón Jiménez 2023-07-13 03:01:53 +02:00
parent a9987cb32e
commit d367584057
No known key found for this signature in database
GPG key ID: 140CC052C94F138E

View file

@ -1104,10 +1104,8 @@ impl Viewport {
let AbsoluteOffset { x, y } = self.absolute_offset();
AbsoluteOffset {
x: ((self.content_bounds.width - self.bounds.width).max(0.0) - x)
.max(0.0),
y: ((self.content_bounds.height - self.bounds.height).max(0.0) - y)
.max(0.0),
x: (self.content_bounds.width - self.bounds.width).max(0.0) - x,
y: (self.content_bounds.height - self.bounds.height).max(0.0) - y,
}
}