Validate Illustrator clipboard sample and record QCAD workflow

This commit is contained in:
Dandaedre 2026-11-15 17:11:15 +01:00
parent c06039a2c8
commit e8f13a5825
6 changed files with 75 additions and 3 deletions

View File

@ -0,0 +1,14 @@
# Illustrator SVG clipboard sample
Supplied by the user on 2026-11-15 as Illustrator clipboard text. The fixture
removes chat Markdown escaping, restores Markdown-linked namespace URLs to plain
URLs, and decodes chat ` ` indentation as spaces. SVG values and element
order are unchanged. Illustrator version, platform and copy command were not supplied.
Expected geometry: two 1814.174 × 1020.473 rectangles at (0.354, 0.354) and
(395.791, 461.357). Both have a 0.709-unit centered stroke. Including outlines
expands each side by 0.3545, giving 1814.883 × 1021.182 bounds. The first outline
starts at (-0.0005, -0.0005); do not clamp away this fractional offset.
This validates the supplied SVG text through the paste parser, not Illustrator's
other native clipboard formats or live operating-system clipboard delivery.

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="2210.319" height="1482.184" viewBox="0 0 2210.319 1482.184">
<title>Untitled-1</title>
<g>
<rect x="0.354" y="0.354" width="1814.174" height="1020.473" fill="none" stroke="#00ffff" stroke-width="0.709" stroke-miterlimit="10"/>
<rect x="395.791" y="461.357" width="1814.174" height="1020.473" fill="none" stroke="#0000ff" stroke-width="0.709" stroke-miterlimit="10"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 522 B

View File

@ -31,6 +31,36 @@ fn supplied_figma_svg_clipboard_preserves_rectangle_order_and_translation() {
}
}
#[test]
fn supplied_illustrator_svg_clipboard_preserves_fractional_bounds_and_strokes() {
let doc = parse_values(include_str!("fixtures/illustrator-rectangles.svg")).unwrap();
assert!(doc.svg);
assert_eq!(doc.shapes.len(), 2);
for (shape, (x, y)) in doc.shapes.iter().zip([(0.354, 0.354), (395.791, 461.357)]) {
let expected = Geometry {
x,
y,
width: 1814.174,
height: 1020.473,
};
close(shape.geometry.x, expected.x);
close(shape.geometry.y, expected.y);
close(shape.geometry.width, expected.width);
close(shape.geometry.height, expected.height);
assert!(!shape.background);
assert!(!shape.background_only);
assert_eq!(shape.outline, [0.709, 0.709]);
assert_eq!(
shape.paste_geometry(expected, true, false).unwrap(),
shape.geometry
);
let outlined = shape.paste_geometry(expected, true, true).unwrap();
close(outlined.x, x - 0.3545);
close(outlined.y, y - 0.3545);
close(outlined.width, 1814.883);
close(outlined.height, 1021.182);
}
}
#[test]
fn svg_detects_rectangles_background_names_transforms_and_outlines() {
let doc=parse_svg(&svg(r#"<rect id="background" width="100%" height="100%" fill="black"/><g transform="translate(12 20) scale(2 3)" stroke="white" stroke-width="4"><rect id="presenter" x="10" y="30" width="100" height="50"/><rect id="slides" x="150" y="30" width="100" height="50"/></g>"#)).unwrap();
assert_eq!(doc.shapes.len(), 3);

View File

@ -4,6 +4,11 @@
## Unreleased
- Validate the supplied Illustrator SVG clipboard sample with regression coverage
for fractional coordinates and optional centered-stroke bounds. Record QCAD as
a file-exchange workflow based on user feedback; no clipboard adapter is planned.
Existing SVG parsing handles the sample; live clipboard delivery remains unverified.
- Mark export/workflow cleanup solved following user confirmation; move it from
the remaining backlog to completed implementation.

View File

@ -76,6 +76,19 @@ Paste SVG text and review the detected shapes in the mapping dialog.
This evidence covers the supplied SVG text only; native Figma binary/HTML
clipboard formats and live clipboard delivery have not been validated.
### Illustrator SVG clipboard text
The supplied [Illustrator SVG sample](../../../crates/canvas-pilot/tests/fixtures/illustrator-rectangles.svg)
works through the existing SVG/value paste parser. Its two 1814.174 × 1020.473
rectangles retain fractional positions (0.354, 0.354) and (395.791, 461.357).
Enabling outline inclusion adds the centered 0.709-unit stroke to their bounds,
producing 1814.883 × 1021.182 boxes. Stroke colors are not imported as artwork
through this geometry workflow. Other native Illustrator clipboard formats and
live clipboard delivery have not been validated.
For QCAD, use file exchange; no clipboard adapter is planned for the user's
reported workflow.
### draw.io clipboard
The draw.io adapter accepts single-page `.drawio`/`.xml` files (including native

View File

@ -73,9 +73,11 @@ device readback and physical-screen acceptance.
- [ ] **Additional native clipboard adapters.** Obtain actual software/version
clipboard samples before implementing or claiming Inkscape, Illustrator, Figma,
etc. native clipboard support. The supplied Figma SVG-text sample is covered
by a paste-parser regression test; native clipboard formats and live delivery
remain unverified. File import is not native clipboard compatibility.
etc. native clipboard support. The supplied Figma and Illustrator SVG-text
samples are covered by paste-parser regression tests; other native clipboard
formats and live delivery remain unverified. QCAD is a file-exchange workflow
per user feedback, with no clipboard adapter planned. File import is not native
clipboard compatibility.
- [ ] **Non-Centered/masked Midra layer import.** Expand conversion only after
verifying those semantics. Source routing synchronization remains separate
from the opt-in shared-input settings editor.