diff options
author | 2023-07-13 03:01:53 +0200 | |
---|---|---|
committer | 2023-07-13 03:01:53 +0200 | |
commit | d36758405789d6a305d978eefb46a1ca90d141d2 (patch) | |
tree | 05fb413e814c62ef343e4d21e242e9c954e8ecd4 /widget/src/scrollable.rs | |
parent | a9987cb32e4d65b83f134ba54f51dffe16e93a50 (diff) | |
download | iced-d36758405789d6a305d978eefb46a1ca90d141d2.tar.gz iced-d36758405789d6a305d978eefb46a1ca90d141d2.tar.bz2 iced-d36758405789d6a305d978eefb46a1ca90d141d2.zip |
Avoid redundant `max` in `absolute_offset_reversed`
I believe `Offset::absolute` guarantees the offset never exceeds the
maximum scrolling boundaries already.
Diffstat (limited to 'widget/src/scrollable.rs')
-rw-r--r-- | widget/src/scrollable.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/widget/src/scrollable.rs b/widget/src/scrollable.rs index 5cd94538..e0aeeebd 100644 --- a/widget/src/scrollable.rs +++ b/widget/src/scrollable.rs @@ -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, } } |