We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d660fad + f3733a8 commit 50340b4Copy full SHA for 50340b4
graphics/src/damage.rs
@@ -45,15 +45,12 @@ pub fn list<T>(
45
/// Groups the given damage regions that are close together inside the given
46
/// bounds.
47
pub fn group(mut damage: Vec<Rectangle>, bounds: Rectangle) -> Vec<Rectangle> {
48
- use std::cmp::Ordering;
49
-
50
const AREA_THRESHOLD: f32 = 20_000.0;
51
52
damage.sort_by(|a, b| {
53
a.center()
54
.distance(Point::ORIGIN)
55
- .partial_cmp(&b.center().distance(Point::ORIGIN))
56
- .unwrap_or(Ordering::Equal)
+ .total_cmp(&b.center().distance(Point::ORIGIN))
57
});
58
59
let mut output = Vec::new();
0 commit comments