🐛 Fix stroke rendering on drag (#9871)

This commit is contained in:
Elena Torró 2026-05-26 13:14:38 +02:00 committed by GitHub
parent 34f30e38aa
commit 75c61f9211
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 0 deletions

View File

@ -1445,6 +1445,7 @@ impl Shape {
path_transform.as_ref(),
&self.selrect,
self.svg_attrs.as_ref(),
true,
) else {
continue;
};

View File

@ -10,12 +10,17 @@ use crate::math::Rect;
/// Uses Skia's `fill_path_with_paint` to expand the stroke into a filled region,
/// then clips it via boolean ops for inner/outer alignment. The optional
/// `path_transform` maps from local shape coords to the drawing space (and back).
///
/// When `solid_outline` is true, any dash/dot PathEffect is stripped so the result
/// is a continuous stroke region — useful for clipping (e.g. drag crop cache) where
/// dash gaps should not punch holes in the clip mask.
pub fn stroke_to_path(
stroke: &Stroke,
shape_path: &Path,
path_transform: Option<&skia::Matrix>,
selrect: &Rect,
svg_attrs: Option<&SvgAttrs>,
solid_outline: bool,
) -> Option<Path> {
let skia_shape_path = shape_path.to_skia_path(svg_attrs);
@ -28,6 +33,10 @@ pub fn stroke_to_path(
let is_open = shape_path.is_open();
let mut paint = stroke.to_paint(selrect, svg_attrs, true);
if solid_outline {
paint.set_path_effect(None);
}
let render_kind = stroke.render_kind(is_open);
if render_kind != StrokeKind::Center {
paint.set_stroke_width(stroke.width * 2.0);

View File

@ -255,6 +255,7 @@ pub extern "C" fn convert_stroke_to_path(stroke_index: i32) -> *mut u8 {
path_transform.as_ref(),
&shape.selrect,
shape.svg_attrs.as_ref(),
false,
) {
result = path
.segments()