From 3d7479f9aae60636bd6688331e001495ef9c6207 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elena=20Torr=C3=B3?= Date: Tue, 1 Apr 2025 09:55:19 +0200 Subject: [PATCH] :bug: Fix stroke image rendering (#6189) --- render-wasm/src/render/strokes.rs | 8 +++++++- render-wasm/src/shapes/strokes.rs | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/render-wasm/src/render/strokes.rs b/render-wasm/src/render/strokes.rs index 13f130b331..b906685ecb 100644 --- a/render-wasm/src/render/strokes.rs +++ b/render-wasm/src/render/strokes.rs @@ -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 { diff --git a/render-wasm/src/shapes/strokes.rs b/render-wasm/src/shapes/strokes.rs index 6c1af2d7d2..c1372d224c 100644 --- a/render-wasm/src/shapes/strokes.rs +++ b/render-wasm/src/shapes/strokes.rs @@ -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., } }