M3.44: graphic styles keep opacity and blend, capture groups and type, add on Alt-click

Styles now store the object's opacity, blend mode, isolate and knockout and apply them.
New Graphic Style from a group without its own paint captures its topmost object's
appearance, and from type its characters' fill and stroke. Names are made unique.
graphicStyle.apply takes ids and add (Alt-click in the panel adds the style on top of the
existing appearance). graphicStyle.list reports every style. Applying links objects to a
stable style id (Node.graphic_style), which the management commands build on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bflatastic
2026-10-04 23:01:10 +07:00
co-authored by Claude Opus 5.5
parent 6bd27a05da
commit eb83efdb19
6 changed files with 864 additions and 106 deletions
+5
View File
@@ -270,6 +270,10 @@ pub struct Node {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub graph: Option<Box<crate::graph::GraphSpec>>,
pub kind: NodeKind,
/// The [`crate::GraphicStyle::id`] last applied to this object. It stays linked while it keeps
/// that style's look: editing its appearance or transparency breaks the link.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub graphic_style: Option<u32>,
}
/// Opacity mask: the luminance of the mask art sets the object's opacity (white = opaque).
@@ -314,6 +318,7 @@ impl Node {
wrap: None,
graph: None,
kind,
graphic_style: None,
}
}
pub fn path(id: NodeId, path: PathData, appearance: Appearance) -> Self {