M3.21: active-row edits of the other kind stay on the painted leaves, item transparency is one undo step

- A fill row no longer turns stroke edits (stroke.set, setAdvanced, paint.setStroke, gradients) into
  a new stroke on a selected group's own stack: an active row only stands for edits of its kind.
- Removing, duplicating or moving items of other objects (`ids`) no longer re-points the active row.
- transparency.set with an item touches the item only for opacity/blend (isolate or knockout alone
  is one undo step) and rejects unknown blend modes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bflatastic
2026-10-04 17:50:46 +07:00
co-authored by Claude Opus 5.5
parent 3692b9d233
commit 1b3e7110a3
7 changed files with 101 additions and 40 deletions
+2 -5
View File
@@ -7,7 +7,6 @@
use serde_json::{Value, json};
use vectorcraft_color::Paint;
use vectorcraft_doc::AppearanceItem;
use vectorcraft_doc::hit::hit_test;
use vectorcraft_geom::{Point, Vec2};
@@ -27,10 +26,8 @@ pub struct GradientTool {
pub fn annotator(cx: &ToolContext) -> Option<(Point, Point, Vec<f32>)> {
cx.selection.objects.iter().find_map(|id| {
let n = cx.doc.node(*id)?;
let item = cx.appearance_item.and_then(|i| n.appearance.items.get(i));
let paint = match item {
Some(AppearanceItem::Stroke(s)) => &s.paint,
Some(AppearanceItem::Fill(f)) => &f.paint,
let paint = match cx.appearance_item.and_then(|i| n.appearance.items.get(i)) {
Some(item) => item.paint(),
None => &n.appearance.fill()?.paint,
};
let Paint::Gradient(g) = paint else { return None };