mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-17 14:14:50 +00:00
path.split (Scissors) and path.cutAtAnchors (Cut Path at Selected Anchor Points) keep the source path's fill and stroke settings on the paths they make, and now set every stroke's alignment to Center in the same undo step, as the help page describes: https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/modify-paths/split-paths.html Every stroke row is reset, hidden ones included. A path of several subpaths has one appearance, so its other subpaths' strokes are centered too, and a cut member of a compound path centers the compound path's strokes. An appearance whose strokes are already centered is left shared. Knife, the erasers and Divide are unchanged.
37 lines
1.3 KiB
Rust
37 lines
1.3 KiB
Rust
//! Commands backing the drawing tools (pencil, curvature, anchor tools, scissors, knife, eraser,
|
|
//! blob brush, smooth, path eraser, join).
|
|
|
|
use std::collections::BTreeSet;
|
|
use std::sync::Arc;
|
|
|
|
use kurbo::{CubicBez, ParamCurve, ParamCurveNearest};
|
|
use serde_json::{Value, json};
|
|
use vectorcraft_color::{Color, Paint};
|
|
use vectorcraft_doc::{AngleProfile, Appearance, Document, Node, NodeId, NodeKind, PressureProfile, Selection};
|
|
use vectorcraft_geom::hit::fill_contains;
|
|
use vectorcraft_geom::{Anchor, AnchorKind, BezPath, FillRule, PathData, Point, Rect, SubPath, Vec2};
|
|
use vectorcraft_pathops as po;
|
|
use vectorcraft_pathops::{BoolOp, Cap, Join, SimplifyOptions};
|
|
use vectorcraft_tools::draw2::{eraser_area, eraser_tip};
|
|
|
|
use super::create::{add_look, insert_look};
|
|
use super::newart::NewArt;
|
|
use super::pathops::{Beside, remove_each};
|
|
use super::{
|
|
CommandSpec, Result, Session, bad, check_numbers, cmd, f64_or, has_anchors, has_doc, has_selection, index, number_or, object_param, ok,
|
|
str_param, switch_or,
|
|
};
|
|
use crate::EngineError;
|
|
|
|
mod anchors;
|
|
mod commands;
|
|
mod common;
|
|
mod cut;
|
|
mod freehand;
|
|
mod smooth;
|
|
|
|
pub use commands::specs;
|
|
pub(super) use common::{center_strokes, ids_json, replace_with_pieces, usize_opt};
|
|
pub(super) use cut::{components, erase_outline};
|
|
pub(super) use freehand::freehand_brushed;
|