mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +01:00
🐛 Fix stroke image rendering (#6189)
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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.,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user