Repository navigation
AI import: a pattern fill tiles from its tile's lower left, wherever the definition drew the tile - #2016
Merged
Conversation
Messhias
suggested changes
Oct 15, 2026
Messhias
left a comment
Contributor
There was a problem hiding this comment.
cargo xtask ci is incomplete or unchecked on this PR. Run it end to end (fmt, clippy, tests, assets, brands, layers, wasm), tick the checklist when green, and reply here with the outcome. That is required before any approve from here.
…the definition drew the tile Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bflatastic
force-pushed
the
fix/ai-pattern-phase
branch
from
October 15, 2026 19:38
1b875c2 to
a3081b9
Compare
Member
|
Thanks @EricKuck! Merged after a full gate. |
Member
|
One note: |
3 of 4 tasks
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.
What and why
A
.aipattern definition (%AI3_BeginPattern) gives its tile as a box in the pattern's own space,(name) llx lly urx ury, and draws its art there. A fill with it (p/P) carries the matrix from the pattern's space to the art.pattern_paintincrates/eps/src/import/ai/read.rsbuilt the fill's transform with an extratranslate(origin), the tile's top left, but the renderer already places each tile's art relative to its tile (PatternDef::instance_xf). The tile's position was counted twice, so every fill whose definition drew its tile away from (0, 0) tiled shifted by that position, modulo the tile size.The fill now places the tile's lower left at the pattern's origin, whatever box the definition drew it in. A tile drawn at (0, 0) tiles exactly as before.
Across the
.aifiles we own, 410 of 442 pattern definitions draw their tile away from (0, 0). Checked against the files' own PDF pages: a 256-point scale pattern was shifted by (−55, +56) points; it now lands on the page's tiling exactly (cross-correlation peak at zero shift), and the artboard's difference from the page drops from 94 % to 25 % of its pixels (what's left is a separate issue, gradients inside the tiles), and another artboard's from 11.4 % to 2.5 %. Of 73 artboards across 20 files that fill with patterns, those two improve and none get worse.How it was tested
crates/eps/src/import/ai/tests.rs(hand-written input):a_pattern_tiles_from_its_lower_left_wherever_its_definition_drew_itmoves the existingDotsdefinition's tile and art to 30..38 × 40..48 and checks the fill places the tile where the original at 0..8 × 0..8 does. It fails without the change.patterns_are_pattern_swatches_and_fill_with_thempasses unchanged.cargo test -p vectorcraft-eps(201 tests) passes.Checklist
-D warnings; the only hits are pre-existing upstream lints in crates this PR doesn't touch,crates/pdf/src/import_scan.rsamong them), the tests above, brands.unwrap(),expect(),panic!,unreachable!,todo!orunimplemented!outside tests, and no unchecked indexing on data from files, parameters or messages.