vectorcraft/crates/effects/src
arhammusheer 0724aafbb6 #1172: share an object's appearance with its undo history until it changes
Every edit of an object copied its whole appearance (its fills, strokes and effects, about
540 bytes for a basic object) into the new node, though a move leaves it as it is. Over 45
whole-selection moves of 10,000 paths, undo history grew by 589 MB; now 349 MB (41 % less), and
a nudge or a drag of the selection takes 12 ms instead of 15.

- Node::appearance is a vectorcraft_doc::Shared<Appearance>: copy-on-write. A clone shares it,
  and the first change through DerefMut copies it (Arc::make_mut). Reads, writes, equality (also
  against a plain Appearance) and the saved form are those of the Appearance itself, so call
  sites read and change it as before. Sites that build or assign a whole appearance add .into(),
  and the few that need a plain copy take (*n.appearance).clone().
- Node::transform changes the appearance only when it has gradients to transform, and pattern
  paints are transformed only when there are some: a move no longer copies an appearance it
  doesn't change.

The workspace suite (5,301 tests) and clippy pass with the change; the doc and engine suites
pass again after the transform guard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VmMmc1J8XeNLxhRihWv9cc
2026-10-11 23:27:21 +07:00
..
pixel Part of gap 2: Effect › Brush Strokes (Accented Edges, Angled Strokes, Crosshatch, Dark Strokes, Ink Outlines, Spatter, Sprayed Strokes, Sumi-e) 2026-10-11 01:19:26 +07:00
stroke M14.4: tests main gained follow the no-panic lint rules 2026-10-05 06:40:34 +07:00
adjust.rs Fix #122: colour adjustment live effects (Effect > Color Adjustments) 2026-10-06 00:42:26 +07:00
bake.rs #1172: share an object's appearance with its undo history until it changes 2026-10-11 23:27:21 +07:00
clip.rs M3.26: clipping sets with any clip shape 2026-10-04 17:23:57 +07:00
distort.rs Part of #885: the Transform effect's dialog takes Transform Each's controls 2026-10-10 14:32:10 +07:00
group.rs Part of #885: the Transform effect's dialog takes Transform Each's controls 2026-10-10 14:32:10 +07:00
lib.rs Part of gap 2: Effect › Brush Strokes (Accented Edges, Angled Strokes, Crosshatch, Dark Strokes, Ink Outlines, Spatter, Sprayed Strokes, Sumi-e) 2026-10-11 01:19:26 +07:00
live.rs M8.16: Envelopes bend images, symbols, gradients, patterns and appearance; warps keep their frame 2026-10-06 12:01:47 +07:00
marks.rs M3.77: [Registration] swatch on every plate, trim marks on every artboard, Japanese marks and live Crop Marks 2026-10-05 03:46:04 +07:00
raster.rs Fix #827: shadows and glows keep their blend modes in PDF 2026-10-10 10:28:04 +07:00
reshape.rs #1172: share an object's appearance with its undo history until it changes 2026-10-11 23:27:21 +07:00
revolve.rs #1172: share an object's appearance with its undo history until it changes 2026-10-11 23:27:21 +07:00
stroke.rs M3.83: gradients within, along or across a stroke 2026-10-05 05:47:54 +07:00
stylize.rs clippy: as_chunks for fixed-size pixel and pair chunks (Rust 1.99 lint was red on main) 2026-10-05 06:24:06 +07:00
tests.rs Part of #885: the Transform effect's dialog takes Transform Each's controls 2026-10-10 14:32:10 +07:00
tests_scale.rs M3.66: Scale Strokes & Effects scales dashes and effect distances; Scale Corners works 2026-10-05 03:59:37 +07:00
util.rs Rename DrawCraft → VectorCraft: crates (vectorcraft-*), apps, binaries, types, env vars, docs, examples (.vectorcraft); old .drawcraft files and preferences still load. Fix: text bounds exact after opening a file; selection no longer marks a document modified (dirty = content differs from the saved document). Screenshots and renders regenerated. 2026-10-01 14:30:09 -04:00
warp.rs Rename DrawCraft → VectorCraft: crates (vectorcraft-*), apps, binaries, types, env vars, docs, examples (.vectorcraft); old .drawcraft files and preferences still load. Fix: text bounds exact after opening a file; selection no longer marks a document modified (dirty = content differs from the saved document). Screenshots and renders regenerated. 2026-10-01 14:30:09 -04:00