diff options
author | 2023-04-27 15:25:59 +0200 | |
---|---|---|
committer | 2023-04-27 15:25:59 +0200 | |
commit | 38f82ab35fd24a1aaf96728148b2826211956a9f (patch) | |
tree | 959107689459c0d3f97b62b8e2dc85017838ab24 /graphics/src/damage.rs | |
parent | 200a29c069ae0c6461b6d44e075aacc9ddad9974 (diff) | |
download | iced-38f82ab35fd24a1aaf96728148b2826211956a9f.tar.gz iced-38f82ab35fd24a1aaf96728148b2826211956a9f.tar.bz2 iced-38f82ab35fd24a1aaf96728148b2826211956a9f.zip |
Expand damage regions of `Clip` primitives a bit
Diffstat (limited to 'graphics/src/damage.rs')
-rw-r--r-- | graphics/src/damage.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/graphics/src/damage.rs b/graphics/src/damage.rs index 63604150..5aab06b1 100644 --- a/graphics/src/damage.rs +++ b/graphics/src/damage.rs @@ -17,19 +17,21 @@ pub fn regions(a: &Primitive, b: &Primitive) -> Vec<Rectangle> { Primitive::Clip { bounds: bounds_a, content: content_a, + .. }, Primitive::Clip { bounds: bounds_b, content: content_b, + .. }, ) => { if bounds_a == bounds_b { return regions(content_a, content_b) .into_iter() - .filter_map(|r| r.intersection(bounds_a)) + .filter_map(|r| r.intersection(&bounds_a.expand(1.0))) .collect(); } else { - return vec![*bounds_a, *bounds_b]; + return vec![bounds_a.expand(1.0), bounds_b.expand(1.0)]; } } ( |