feat(svm): draw a curve as a curve, not as a line through its control points - #791
Merged
Conversation
andiwand
force-pushed
the
feat/svm-map-mode
branch
from
August 30, 2026 18:29
16bb53a to
5daba1a
Compare
andiwand
force-pushed
the
feat/svm-beziers
branch
from
August 30, 2026 18:38
a210209 to
5773ea7
Compare
… points Closes the last of #772's defects. A polygon that carries curves is written twice: first its corners alone, then again as `Polygon::Read` writes it, with one `PolyFlags` per point. We read the flag byte that says the second one follows, dropped it, and drew the first - so every curve came out as a line through what were its control points. `PolyFlags::Control` marks a control point and three in a row are one bezier segment, which is an svg `C`. A poly-polygon says the same thing through its "complex polygons": each names by index the polygon it replaces with the same shape, curves included. The polygon a shape is made of therefore carries its flags now, which is what `svgwriter.cxx`'s `GetPathString` walks too. For the same polygon LibreOffice writes `M 100,700 C 300,100 700,100 900,700`, and so do we. Nothing in the corpus draws a curve - not one of the 1125 metafiles harvested from the fixtures carries a flag - so no rendering moves. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CmCr22NW6wPQKiQidk96bq
andiwand
force-pushed
the
feat/svm-beziers
branch
from
August 30, 2026 18:58
5773ea7 to
d6f9598
Compare
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.
🤖 Generated with Claude Code
Stage 9 of #772, closing the last of its ten defects, stacked on #790 →
#789 → #788 → #787 → #786 → #785 → #784 → #779 — review those first; this
branch's base is
feat/svm-map-mode.A polygon that carries curves is written twice: first its corners alone,
then again as
Polygon::Readwrites it —VersionCompat, the points, and onePolyFlagsper point. We read the flag byte that says the second one follows,dropped it, and drew the first. Every curve therefore came out as a line
through what were its control points.
PolyFlags::Controlmarks a control point, three in a row are one beziersegment, and that is an svg
C. A poly-polygon says the same thing through its"complex polygons": each names by index the polygon it replaces with the same
shape, curves included — also read and dropped until now.
The polygon a shape is made of therefore carries its flags now, which is what
svgwriter.cxx'sGetPathStringwalks too.Checked against LibreOffice
For a metafile written by hand with one flagged polygon, LibreOffice's own
export writes
and so do we, character for character.
Nothing in the corpus moves
Not one of the 1125 metafiles harvested from the fixtures carries a polygon
flag or a complex poly-polygon, so no reference output changes and there is no
pin bump. The 3 new tests (47 in the svm suite) are inline bytes: a polyline
with flags curves, the same polyline without them is lines, and a complex
poly-polygon replaces its polygon.
What is left after this
svm/PLAN.mdnames it:WALLPAPER,FLOATTRANSPARENTandEPS, which allnest something of their own; the
MASKfamily;MOVECLIPREGION;ZCOMPRESSed bitmaps; and version-1 (pre-VCLMTF) files. None of them occursin the corpus, and each is logged where it is skipped.