From 38f82ab35fd24a1aaf96728148b2826211956a9f Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 27 Apr 2023 15:25:59 +0200 Subject: Expand damage regions of `Clip` primitives a bit --- graphics/src/damage.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'graphics/src/damage.rs') 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 { 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)]; } } ( -- cgit