mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-25 10:17:02 -06:00
VectorCraft writes and reads SVG at 1 user unit (CSS px) = 1 pt, but a root width/height in absolute units was taken in CSS pixels (96 per inch). An A4 document from Inkscape (width="210mm" height="297mm" viewBox="0 0 210 297") opened on a 793.7 × 1122.5 pt artboard, i.e. 280 × 396 mm, with all art 4/3 too large, and its PDF export came out on that page size; width="8.5in" gave an 11.3 inch artboard and width="300pt" a 400 pt one. When the root width or height has an absolute unit (in, cm, mm, pt, pc) the import now scales by 72/96 along that axis, so the artboard and the art keep their physical size (595.3 × 841.9 pt for A4); geometry, stroke widths and text follow through the same transform. Unitless, px, % and viewBox-only files are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>