M4.88: Object → Slice makes, edits and lays out user, object and auto slices

Document.slices holds user slices, Node.slice makes an object an object
slice that follows its bounds, and Document.slices_clip_to_artboard picks
the region auto slices fill (the artboards, or the art and the slices).
Object → Slice: Make, Release, Create from Guides, Create from Selection,
Duplicate, Combine, Divide… (dialog), Delete All, Slice Options… (dialog)
and Clip to Artboard; View → Hide/Lock Slices; Select → Object → Slices;
slice.list reads the numbered layout. The canvas draws the slices in the
Slices preferences' line colour with their numbers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bflatastic
2026-10-05 12:52:15 +07:00
co-authored by Claude Opus 5.5
parent d767fa22e0
commit 271b0c6c25
19 changed files with 1761 additions and 1 deletions
+5
View File
@@ -331,6 +331,10 @@ pub struct Node {
/// Attributes panel: centre point display, image map, URL and note (`None`: all defaults).
#[serde(default, skip_serializing_if = "Option::is_none")]
pub attrs: Option<Box<ObjectAttributes>>,
/// Object → Slice → Make: the object is an object slice (its slice follows its bounds) with
/// these options.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub slice: Option<Box<crate::SliceOptions>>,
}
/// Opacity mask: the luminance of the mask art sets the object's opacity (white = opaque).
@@ -378,6 +382,7 @@ impl Node {
kind,
graphic_style: None,
attrs: None,
slice: None,
}
}
pub fn path(id: NodeId, path: PathData, appearance: Appearance) -> Self {