0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-04-09 21:41:23 -05:00

🐛 Fix stroke image rendering (#6189)

This commit is contained in:
Elena Torró 2025-04-01 09:55:19 +02:00 committed by GitHub
parent 76ffc2d268
commit 3d7479f9aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 3 deletions

View file

@ -451,7 +451,13 @@ fn draw_image_stroke_in_container(
// Compute scaled rect and clip to it
let dest_rect = calculate_scaled_rect(size, container, stroke.delta());
canvas.clip_rect(dest_rect, skia::ClipOp::Intersect, antialias);
canvas.draw_image_rect(image.unwrap(), None, dest_rect, &image_paint);
canvas.draw_image_rect_with_sampling_options(
image.unwrap(),
None,
dest_rect,
render_state.sampling_options,
&image_paint,
);
// Clear outer stroke for paths if necessary. When adding an outer stroke we need to empty the stroke added too in the inner area.
if let Type::Path(p) = &shape.shape_type {

View file

@ -116,8 +116,8 @@ impl Stroke {
pub fn delta(&self) -> f32 {
match self.kind {
StrokeKind::InnerStroke => 0.,
StrokeKind::CenterStroke => self.width / 2.,
StrokeKind::OuterStroke => self.width,
StrokeKind::CenterStroke => self.width,
StrokeKind::OuterStroke => self.width * 2.,
}
}