desktop: Fixup intersection calls

This commit is contained in:
Victor Brekenfeld 2021-12-20 19:12:21 +01:00
parent a948ff8829
commit 827a3c8c2a
2 changed files with 4 additions and 8 deletions

View File

@ -165,8 +165,7 @@ where
let new_damage = damage
.iter()
.cloned()
.filter(|geo| geo.overlaps(rect))
.map(|geo| geo.intersection(rect))
.flat_map(|geo| geo.intersection(rect))
.map(|mut geo| {
geo.loc -= rect.loc;
geo

View File

@ -570,8 +570,7 @@ impl Space {
if damage.iter().any(|geo| lgeo.overlaps(*geo)) {
let layer_damage = damage
.iter()
.filter(|geo| geo.overlaps(lgeo))
.map(|geo| geo.intersection(lgeo))
.flat_map(|geo| geo.intersection(lgeo))
.map(|geo| Rectangle::from_loc_and_size(geo.loc - lgeo.loc, geo.size))
.collect::<Vec<_>>();
slog::trace!(
@ -600,8 +599,7 @@ impl Space {
loc -= output_geo.loc;
let win_damage = damage
.iter()
.filter(|geo| geo.overlaps(wgeo))
.map(|geo| geo.intersection(wgeo))
.flat_map(|geo| geo.intersection(wgeo))
.map(|geo| Rectangle::from_loc_and_size(geo.loc - loc, geo.size))
.collect::<Vec<_>>();
slog::trace!(
@ -631,8 +629,7 @@ impl Space {
if damage.iter().any(|geo| lgeo.overlaps(*geo)) {
let layer_damage = damage
.iter()
.filter(|geo| geo.overlaps(lgeo))
.map(|geo| geo.intersection(lgeo))
.flat_map(|geo| geo.intersection(lgeo))
.map(|geo| Rectangle::from_loc_and_size(geo.loc - lgeo.loc, geo.size))
.collect::<Vec<_>>();
slog::trace!(