diff --git a/core/src/gradient.rs b/core/src/gradient.rs index ccae0bce..722c3c5c 100644 --- a/core/src/gradient.rs +++ b/core/src/gradient.rs @@ -70,7 +70,7 @@ impl Linear { let (Ok(index) | Err(index)) = self.stops.binary_search_by(|stop| match stop { None => Ordering::Greater, - Some(stop) => stop.offset.partial_cmp(&offset).unwrap(), + Some(stop) => stop.offset.total_cmp(&offset), }); if index < 8 { diff --git a/graphics/src/gradient.rs b/graphics/src/gradient.rs index 54261721..95593c59 100644 --- a/graphics/src/gradient.rs +++ b/graphics/src/gradient.rs @@ -67,7 +67,7 @@ impl Linear { let (Ok(index) | Err(index)) = self.stops.binary_search_by(|stop| match stop { None => Ordering::Greater, - Some(stop) => stop.offset.partial_cmp(&offset).unwrap(), + Some(stop) => stop.offset.total_cmp(&offset), }); if index < 8 {