diff options
Diffstat (limited to '')
-rw-r--r-- | graphics/src/damage.rs | 6 | ||||
-rw-r--r-- | graphics/src/primitive.rs | 2 |
2 files changed, 5 insertions, 3 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)]; } } ( diff --git a/graphics/src/primitive.rs b/graphics/src/primitive.rs index 1751d03a..d6a2c4c4 100644 --- a/graphics/src/primitive.rs +++ b/graphics/src/primitive.rs @@ -179,7 +179,7 @@ impl Primitive { Self::Quad { bounds, .. } | Self::Image { bounds, .. } | Self::Svg { bounds, .. } => bounds.expand(1.0), - Self::Clip { bounds, .. } => *bounds, + Self::Clip { bounds, .. } => bounds.expand(1.0), Self::SolidMesh { size, .. } | Self::GradientMesh { size, .. } => { Rectangle::with_size(*size) } |