Outline Stroke: use Expand's reshaped helper instead of a second copy

outline_strokes in pathops.rs now imports reshaped from expand.rs, which
has had it since #2616, and the copies of reshaped and with_path that
this branch added to pathops.rs are removed. The two copies were
identical, so Outline Stroke and Expand behave as before.
This commit is contained in:
dotCooCoo
2026-10-20 20:08:18 -07:00
parent 19b33c2af5
commit a5f3298a0c
2 changed files with 2 additions and 27 deletions
+1 -1
View File
@@ -351,7 +351,7 @@ fn gradient_art(d: &mut Document, l: &Node, path: &PathData, bounds: Rect, f: &F
/// Path `l` as the canvas paints its fills and strokes: its visible geometry effects applied to its
/// path (a plain path then), and every geometry effect of its own removed. `None` when it has no
/// visible geometry effect.
fn reshaped(l: &Node) -> Option<Node> {
pub(crate) fn reshaped(l: &Node) -> Option<Node> {
use vectorcraft_render::effects::{GeomContext, apply_geometry_with, has_geometry, is_geometry};
if !has_geometry(&l.appearance.effects) {
return None;
+1 -26
View File
@@ -13,6 +13,7 @@ use vectorcraft_pathops as po;
use vectorcraft_pathops::{BoolOp, PathfinderOp};
use super::edit::selected_roots;
use super::expand::reshaped;
use super::*;
pub fn specs() -> Vec<CommandSpec> {
@@ -679,32 +680,6 @@ pub(crate) fn outline_strokes(d: &mut Document, brushes: &[vectorcraft_brush::Br
assemble(d, l, parts)
}
/// Path `l` as the canvas paints its fills and strokes: its visible geometry effects applied to its
/// path (a plain path then), and every geometry effect of its own removed. `None` when it has no
/// visible geometry effect.
pub(crate) fn reshaped(l: &Node) -> Option<Node> {
use vectorcraft_render::effects::{GeomContext, apply_geometry_with, has_geometry, is_geometry};
if !has_geometry(&l.appearance.effects) {
return None;
}
let (path, _) = node_path(l)?;
let g = apply_geometry_with(&l.appearance.effects, &path, path.bounds()?, &GeomContext::of(l));
let mut m = with_path(l, g);
m.appearance.effects.retain(|e| !is_geometry(&e.id));
Some(m)
}
/// Path or compound path `l` with `path` as its path, a plain path.
pub(crate) fn with_path(l: &Node, path: PathData) -> Node {
let mut m = l.clone();
m.kind = match &l.kind {
NodeKind::Path { rule, clipping, guide, .. } => NodeKind::Path { path, rule: *rule, live: None, clipping: *clipping, guide: *guide },
NodeKind::Compound { rule, .. } => NodeKind::Path { path, rule: *rule, live: None, clipping: false, guide: false },
k => k.clone(),
};
m
}
/// A plain copy of path `l` (new ids, no transparency, name or mask) painted with `items`.
pub(crate) fn styled_copy(d: &mut Document, l: &Node, items: Vec<AppearanceItem>) -> Node {
let mut f = d.reid(l);