Repository navigation
M4: SVG import keeps symbols, patterns and filters live; linked images, nested clips, reflected gradients (M4.41, M4.42) - #94
Merged
Conversation
<symbol> with <use> imports as a symbol (named after data-name or its id) with one instance per <use>; a <use> that shows the symbol differently (inherited paint, a viewport that cuts it) or that the canvas would paint differently under its transform stays plain art. feGaussianBlur, feDropShadow and the usual shadow chains (offset, blur, flood or colour matrix, composite, merge) become Gaussian Blur, Drop Shadow, Outer/Inner Glow and Feather effects; other filters are still reported. Export records the symbol name and the shadow/glow blend mode so export -> import keeps them. <pattern> keeps importing as a pattern swatch (now tested). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ts nested clips, keeps hidden objects and expands reflected gradients
document.open {path} (and File > Place) find an SVG's relative <image>
links in its folder: raster files stay linked images (LinkInfo with size,
time and hash), SVG files and data: SVGs import as vector art, and a file
that can't be read becomes a placeholder in its box that keeps the link,
with a warning and a missingLinks row (Update Links / Relink read it
later). The SVG library itself reads no file unless given a reader.
Nested clip paths become clip groups in clip groups; undisplayed objects
(display:none) come back hidden; spreadMethod reflect and repeat are
expanded into stops over the painted area (matching resvg). Midpoint stops
and focal points keep folding back as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of M4 (Files). SVG import keeps symbols, patterns and blur/shadow filters live, finds linked images in the SVG's folder, intersects nested clips, keeps hidden objects and expands reflected gradients.
<symbol>with<use>imports as one symbol (named fromdata-name, else its id) with an instance per<use>.<use>stays plain art when it would look different as an instance: paint inherited from the<use>, a viewport that cuts the art, or a transform that would change its look. This uses the export's rules from M4: SVG symbols as <symbol>/<use>, hidden layers, metadata; Preserve Editing round trip (M4.39, M4.40) #72, now shared.<pattern>imports as a pattern swatch (already onmain; now covered by a checker test).feGaussianBlur,feDropShadowand the common shadow chains (offset / blur / flood or colour matrix / composite / merge) become live Gaussian Blur, Drop Shadow, Outer Glow, Inner Glow and Feather effects. Other filters still warn.data-nameon<symbol>anddata-vc-blendon shadow and glow filters, so export → import → export is stable.document.open {path}and Place find an SVG's relative<image>links in its folder (or the folder innamewithdataBase64).LinkInfoand a preview (M4: linked images with previews, missing and modified links; Text Import Options (M4.53, M4.54) #78).data:SVGs import as vector art.missingLinksrow;links.updateandlinks.relinkfill it in later.ImportOptions {folder, read}andimport_with. The library itself no longer reads any file; before, hrefs were resolved against the working directory.display:noneobject comes back hidden.spreadMethodreflect and repeat are expanded into stops, matching resvg in a pixel test.Known limits:
<use>with a filter stays plain art.Checks
Rebased onto
3e8c8d6(#93).cargo xtask cipasses all 7 steps (fmt, clippy, test, assets, brands, layers, wasm): 2,393 tests, 0 failed.mainstill exists (2,362 → 2,388);UI_COMMANDS, menu entries and MCP tools are unchanged.hidden_text_is_skipped_and_use_instances_are_kept: hidden text now comes back hidden.three_instances_give_one_symbol_and_three_uses: the read-back is now one symbol with three instances.an_svg_edited_elsewhere_opens_as_plain_svg_with_a_warning: a plain import now has symbols.🤖 Generated with Claude Code