From 9cc3d68862e098322dbd68782f8d10c53f56bc0c Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Sun, 28 Jun 2026 20:10:42 +0200 Subject: [PATCH] feat(svg): SVG path-data parser for the drawing-card renderer (T-320) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Parse the `d` attribute into an absolute-coordinate SvgPathSeg list, lowering SVG shorthands to a small command set the painter can replay: relative→absolute, H/V→lineTo, S→cubic and T→quad with control reflection, arcs kept as arcTo. Tolerant — malformed tail returns the understood prefix and never throws, so a bad diagram can't crash the conversation. Flutter-free, covered by dart test. First slice of the SVG engine (D-103); no user-visible behaviour yet. Co-Authored-By: Claude Opus 4.8 (1M context) --- .pql/changelog/ticket_history/2026-06.sql | 1 + .pql/changelog/tickets/2026-06.sql | 17 ++ lib/src/svg/svg_path.dart | 267 ++++++++++++++++++++++ test/svg/svg_path_test.dart | 105 +++++++++ 4 files changed, 390 insertions(+) create mode 100644 lib/src/svg/svg_path.dart create mode 100644 test/svg/svg_path_test.dart diff --git a/.pql/changelog/ticket_history/2026-06.sql b/.pql/changelog/ticket_history/2026-06.sql index 3b1649cb..8167d909 100644 --- a/.pql/changelog/ticket_history/2026-06.sql +++ b/.pql/changelog/ticket_history/2026-06.sql @@ -8107,3 +8107,4 @@ CSS DECISION — inline-normalize (option A): d2 emits a