Skip to content

Commit

Permalink
Avoid redundant max in absolute_offset_reversed
Browse files Browse the repository at this point in the history
I believe `Offset::absolute` guarantees the offset never exceeds the
maximum scrolling boundaries already.
  • Loading branch information
hecrj committed Jul 13, 2023
1 parent a9987cb commit d367584
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions widget/src/scrollable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

Expand Down

0 comments on commit d367584

Please sign in to comment.