Skip to content

.ai import: guides past an object's art keep the drawn look under Transform and Free Distort - #7446

Open
dotCooCoo wants to merge 4 commits into
storytold:mainfrom
dotCooCoo:fix/ai-transform-guide-reach
Open

dotCooCoo wants to merge 4 commits into
storytold:mainfrom
dotCooCoo:fix/ai-transform-guide-reach

Conversation

@dotCooCoo

Copy link
Copy Markdown
Contributor

What and why

Follows #7345. In a .ai opened from its editing data, a compound path or group with a Transform that scales, rotates or reflects was read with the effect live whatever guides it held, and so was a group with a Free Distort that moves a corner. The live effect is measured from the object's bounds, and those bounds take in its guides. When a guide reaches past the rest of the object's art, the live effect is placed from a larger box than the art.

  • guides_reach_past (crates/eps/src/import/ai/read/ops.rs) now looks into groups as well as compound paths, and into their members at any depth (deeper than MAX_DEPTH counts as reaching past). It compares the bounds of every guide with the bounds of the rest of the art. A hidden member counts as art.
  • moves_with uses it for Transform (when it scales, rotates or reflects and Transform Objects is on) and for Free Distort on a group (when it moves a corner). Such an object opens as the file's drawn look with the existing "drawn look" warning. This is VectorCraft's own rule.
  • These keep opening live, as before: a Transform that only moves, a Transform with Transform Objects off, a Free Distort on a compound path, and objects whose guides lie inside the rest of their art.
  • The .ai writer keeps a graphic-style link only where the reader reads the style live (object_reads calls style_moves_with, which calls moves_with), so such an object is now written without the link, with the existing style-link warning. The writer code is unchanged.
  • docs/file-format-parity.md and docs/target-app-parity.md state the exception.

This changes how existing files open: a compound path or group whose guides reach past the rest of its art opens as its drawn look instead of live under a Transform that scales, rotates or reflects, and a group does under a Free Distort that moves a corner. A guide one group deeper inside the object counts too.

How it was tested

New tests in vectorcraft-eps:

  • import::ai::tests::transform_and_free_distort_keep_the_drawn_look_where_a_guide_reaches_past_the_rest_of_the_art: a compound path or group with its guide inside, moved, with Transform Objects off (with Transform Patterns off or on), a compound path with Free Distort, a group with Free Distort that moves no corner, and a guide past a square but inside a hidden member open live with the effect and no warning. A compound path scaled, turned or reflected, a group scaled, turned or distorted, and a group whose guide is in a group or compound path inside it, each with a guide past the art, open as the drawn look with the "drawn look" warning. It fails with the guide check removed from Transform or from Free Distort, and with the Transform Objects exemption removed.
  • ai_editing::tests::a_link_to_a_transform_or_free_distort_style_with_a_guide_is_kept_where_the_reader_reads_it: the style link is kept on a compound path with its guide inside, moved, scaled with Transform Objects off (Transform Patterns off or on), or distorted, and on a group with the guide inside; it is dropped with the style-link warning where a scaled compound path or group has its guide past the art. It fails with the guide check removed.

Focused checks on the final tree, on Linux. The branch is one commit on main at 1e4e3534f5. The checks:

  • cargo fmt -p vectorcraft-eps -- --check: clean. cargo fmt --all -- --check reports only crates/svg/src/lib.rs:491, which is on main at 1e4e3534f5 without this branch; open Fix main CI after the craft-libs migration (fmt, wasm) #7407 and fmt: format crates/svg/src/lib.rs #7400 fix it.
  • cargo clippy -p vectorcraft-eps --all-targets -- -D warnings: clean.
  • cargo check --workspace --tests: clean.
  • cargo test -p vectorcraft-eps: 1,565 unit tests and 1 integration test passed, 0 failed.
  • cargo xtask brands: no vendor names; cargo xtask layers: 30 crates, no layering violations; cargo xtask assets: all 337 asset files attributed.
  • cargo xtask ci runs in this pull request's CI.

This branch and #7383, #7367 and #7103 each change the same paragraph of docs/file-format-parity.md, so whichever merges later needs that paragraph merged by hand to keep both clauses; their code files merge cleanly.

Checklist

  • cargo xtask ci passes (fmt, clippy, tests, assets, brands, layers, wasm).
  • No panics in shipped code: no unwrap(), expect(), panic!, unreachable!, todo! or
    unimplemented! outside tests, and no unchecked indexing on data from files, parameters or
    messages. Errors are returned as Result and shown to the user
    (why and how).
  • Clean-room: nothing copied from Adobe products or GPL/AGPL code (AGENTS.md).
  • Every new asset has a row in ASSETS.md.

…nsform and Free Distort

A compound path or group with a Transform that scales, rotates or
reflects was read live whatever guides it held, and so was a group with
a Free Distort that moves a corner. The live effect is measured from
bounds that take in the guides, so where a guide reaches past the rest
of the object's art, the live effect is placed from a larger box than
the art. Such an object now opens as its drawn look. Guides are looked
for in members at any depth, a guide in a group inside the object
included, and a hidden member counts as art.

These keep opening live: a Transform that only moves, a Transform with
Transform Objects off, a Free Distort on a compound path, and objects
whose guides lie inside the rest of their art.

The `.ai` writer keeps a graphic-style link only where the reader reads
the style live, so such an object is now written without the link, with
the existing style-link warning.
@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 33 seconds.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 9f91f96 and 09002ce.

Files selected for processing: 5

  • crates/eps/src/ai_editing/tests.rs
  • crates/eps/src/import/ai/read/ops.rs
  • crates/eps/src/import/ai/tests.rs
  • docs/file-format-parity.md
  • docs/target-app-parity.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant