M3.29: proxy paint commands — paint.invert / paint.complement recolour the active proxy of each selected object keeping its colour model (the defaults when nothing is selected), paint.lastColor (,) and paint.lastGradient (.) re-apply the last solid colour or gradient (the toolbar chips draw and run them), swap and default work on type, and recent colours live in the Session, fed by every paint command (MCP, eyedropper, live previews on commit) and listed by paint.recent

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bflatastic
2026-10-04 18:01:58 +07:00
co-authored by Claude Opus 5.5
parent 8f9d6ef2bd
commit 8a871d98a9
16 changed files with 558 additions and 149 deletions
+5
View File
@@ -118,6 +118,7 @@ fn edit_gradient(s: &mut Session, p: &Value) -> Result<Value> {
let default_paint = if stroke { s.paint.stroke.clone() } else { s.paint.fill.clone() };
let new_default = apply_gradient_edit(&default_paint, p, None).map_err(|e| bad(C, e))?;
if ids.is_empty() {
s.remember_paint(&new_default);
if stroke {
s.paint.stroke = new_default;
} else {
@@ -158,6 +159,10 @@ fn edit_gradient(s: &mut Session, p: &Value) -> Result<Value> {
None => Ok(()),
}
})?;
// The last gradient is the one the first object now shows.
if let Some(shown) = s.doc()?.doc.node(ids[0]).map(|n| super::paint::proxy_paint(n, stroke)) {
s.remember_paint(&shown);
}
if stroke {
s.paint.stroke = new_default;
} else {