diff --git a/crates/gpui/src/geometry.rs b/crates/gpui/src/geometry.rs index bb750e80f8..f2d1102915 100644 --- a/crates/gpui/src/geometry.rs +++ b/crates/gpui/src/geometry.rs @@ -2622,7 +2622,6 @@ impl Pixels { /// Returns: /// * `1.0` if the value is positive /// * `-1.0` if the value is negative - /// * `0.0` if the value is zero pub fn signum(&self) -> f32 { self.0.signum() } diff --git a/crates/gpui/src/interactive.rs b/crates/gpui/src/interactive.rs index c6eab26186..02d0aaac38 100644 --- a/crates/gpui/src/interactive.rs +++ b/crates/gpui/src/interactive.rs @@ -311,13 +311,13 @@ impl ScrollDelta { pub fn coalesce(self, other: ScrollDelta) -> ScrollDelta { match (self, other) { (ScrollDelta::Pixels(a), ScrollDelta::Pixels(b)) => { - let x = if a.x.signum() * b.x.signum() >= 0. { + let x = if a.x.signum() == b.x.signum() { a.x + b.x } else { b.x }; - let y = if a.y.signum() * b.y.signum() >= 0. { + let y = if a.y.signum() == b.y.signum() { a.y + b.y } else { b.y @@ -327,13 +327,13 @@ impl ScrollDelta { } (ScrollDelta::Lines(a), ScrollDelta::Lines(b)) => { - let x = if a.x.signum() * b.x.signum() >= 0. { + let x = if a.x.signum() == b.x.signum() { a.x + b.x } else { b.x }; - let y = if a.y.signum() * b.y.signum() >= 0. { + let y = if a.y.signum() == b.y.signum() { a.y + b.y } else { b.y