vectorcraft/crates/pdf/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
..
print M4.83: overprinting fills and strokes overprint in PDF 2026-10-05 17:39:28 +07:00
editing.rs M4.85: PDF security: encryption at every compatibility level, permissions, either password opens 2026-10-05 15:24:16 +07:00
encrypt.rs Lint: as_chunks for constant chunk sizes, as clippy 1.99 asks 2026-10-05 12:14:56 -07:00
export.rs Fix #847: draw Underline and Strikethrough 2026-10-10 06:03:04 +07:00
forms.rs Part of #372: .ai files write layers and sublayers as PDF layers, hidden ones kept 2026-10-09 04:40:30 +07:00
images.rs Fix #320: CMYK images stay CMYK from PDF import to PDF export 2026-10-08 06:04:07 +07:00
import.rs PDF import: a font the file doesn't carry keeps the style its name says 2026-10-11 04:34:52 +07:00
import_color.rs #1032: spot colours defined in Lab keep their Lab values 2026-10-11 07:06:05 +07:00
import_image.rs PDF import: masked CMYK images stay CMYK, their mask an opacity mask 2026-10-09 17:11:34 +13:00
import_lines.rs M7: inline symbols in text 2026-10-08 15:45:34 -07:00
import_mask.rs Fix #334: .ai import leaves out the white page under the layers 2026-10-08 06:03:45 +07:00
import_scan.rs PDF import: a font the file doesn't carry keeps the style its name says 2026-10-11 04:34:52 +07:00
import_shading.rs EPS import: other apps' EPS open as vectors, a preview that stands in says why 2026-10-08 18:23:36 +07:00
import_text.rs PDF/.ai import: glyphs spaced each their own way keep their place 2026-10-11 12:24:46 +07:00
lab_spot.rs M4.73: PDF colour conversion, ICC profiles and output intent 2026-10-05 16:25:20 +07:00
lib.rs Read Illustrator EPS and .ai layers from their editing data 2026-10-09 03:49:49 -04:00
linearize.rs M4.86: PDF page thumbnails and fast web view (linearised files) 2026-10-05 18:05:36 +07:00
marks.rs M4.75: File → Print writes the job as a print-ready PDF: paper, scale, tiles, marks and bleed, separations 2026-10-05 15:13:10 +07:00
output.rs Colour: ICC CMYK converts straight into the RGB profile, with black-point compensation 2026-10-09 17:11:34 +13:00
pages.rs EPS import: bound what hostile editing data can cost, and say when it can't be read 2026-10-09 03:49:49 -04:00
patch.rs M4.86: PDF page thumbnails and fast web view (linearised files) 2026-10-05 18:05:36 +07:00
pdfx.rs M4.87: PDF 1.3 compatibility: transparency flattened with the chosen preset 2026-10-05 18:05:36 +07:00
post.rs M4.87: PDF 1.3 compatibility: transparency flattened with the chosen preset 2026-10-05 18:05:36 +07:00
presets.rs M4.87: PDF 1.3 compatibility: transparency flattened with the chosen preset 2026-10-05 18:05:36 +07:00
settings.rs Fix #733: PDF export keeps type as text in embedded subset fonts 2026-10-09 18:06:38 +07:00
syntax.rs M4.86: PDF page thumbnails and fast web view (linearised files) 2026-10-05 18:05:36 +07:00
tests.rs #1172: share an object's appearance with its undo history until it changes 2026-10-11 23:27:21 +07:00
tests_blend.rs M4.31: Save PDF dialog and document.exportPdf with PDF settings 2026-10-05 07:22:27 +07:00
tests_charstroke.rs M3.40: stroke on type — the Stroke panel edits the characters' stroke 2026-10-05 01:09:55 +07:00
tests_cmykblend.rs M4.31: Save PDF dialog and document.exportPdf with PDF settings 2026-10-05 07:22:27 +07:00
tests_cmykimages.rs PDF import: masked CMYK images stay CMYK, their mask an opacity mask 2026-10-09 17:11:34 +13:00
tests_compression.rs M4.63: Links panel with status, Relink, Go To, Update, Edit Original, Embed/Unembed, Link Info and Placement Options 2026-10-05 12:40:05 +07:00
tests_dashalign.rs M3.68: groups, layers and type have their own fills, strokes and effects, with Contents and Characters rows 2026-10-05 00:59:34 +07:00
tests_editing.rs M4.43: PDFs and .ai files reopen editable; Save As writes PDF-compatible .ai 2026-10-05 10:34:15 +07:00
tests_encrypt.rs M4.84: PDF/X-1a, PDF/X-3 and PDF/X-4 files written as their standards say 2026-10-05 17:19:11 +07:00
tests_focal.rs M3.98: radial annotator extent ellipse, aspect handle and off-centre focal point 2026-10-05 04:43:43 +07:00
tests_fx.rs M3.43: effects render on type, placed images, symbol instances, blends, envelopes, meshes and repeats; a fill or stroke's own raster effects render and export as SVG filters on that element 2026-10-04 23:15:13 +07:00
tests_import_color.rs #1032: spot colours defined in Lab keep their Lab values 2026-10-11 07:06:05 +07:00
tests_import_fidelity.rs PDF/.ai import: glyphs spaced each their own way keep their place 2026-10-11 12:24:46 +07:00
tests_import_layers.rs PDF import: leave art past the page unclipped in a PDF-compatible .ai 2026-10-10 08:26:48 +07:00
tests_import_lines.rs Fix #508: PDF/.ai import keeps type strokes, wrapped lines and layer order 2026-10-08 22:37:37 +07:00
tests_import_options.rs PDF/.ai import: art of a neighbouring artboard stays on its own page 2026-10-07 13:20:07 +07:00
tests_layers.rs Fix #733: PDF export keeps type as text in embedded subset fonts 2026-10-09 18:06:38 +07:00
tests_live_text.rs Fix #813: type can name an installed version of its font 2026-10-09 19:26:51 +00:00
tests_marks.rs M4.72: PDF export draws printer's marks in Registration around each page 2026-10-05 13:05:20 +07:00
tests_output.rs Fix #320: CMYK images stay CMYK from PDF import to PDF export 2026-10-08 06:04:07 +07:00
tests_pdf13.rs M4.87: PDF 1.3 compatibility: transparency flattened with the chosen preset 2026-10-05 18:05:36 +07:00
tests_pdfx.rs M4.84: PDF/X-1a, PDF/X-3 and PDF/X-4 files written as their standards say 2026-10-05 17:19:11 +07:00
tests_presets.rs M4.84: PDF/X-1a, PDF/X-3 and PDF/X-4 files written as their standards say 2026-10-05 17:19:11 +07:00
tests_print.rs M4.75: File → Print writes the job as a print-ready PDF: paper, scale, tiles, marks and bleed, separations 2026-10-05 15:13:10 +07:00
tests_printadvanced.rs M4.83: overprinting fills and strokes overprint in PDF 2026-10-05 17:39:28 +07:00
tests_realtext.rs PDF/.ai import: glyphs spaced each their own way keep their place 2026-10-11 12:24:46 +07:00
tests_settings.rs Fix #733: PDF export keeps type as text in embedded subset fonts 2026-10-09 18:06:38 +07:00
tests_stroke.rs M3.68: groups, layers and type have their own fills, strokes and effects, with Contents and Characters rows 2026-10-05 00:59:34 +07:00
tests_strokeout.rs M3.68: groups, layers and type have their own fills, strokes and effects, with Contents and Characters rows 2026-10-05 00:59:34 +07:00
tests_textstroke.rs M4.59: pattern strokes and freeform gradients keep their look in PDF 2026-10-05 11:52:35 +07:00
tests_webview.rs M4.86: PDF page thumbnails and fast web view (linearised files) 2026-10-05 18:05:36 +07:00