From 4fdaaa2dd157149d5e7a391d21f4ed40bb24de93 Mon Sep 17 00:00:00 2001 From: Adrian Schoenig Date: Sat, 9 May 2026 15:04:49 +1000 Subject: [PATCH] Close bezier mapBounds path so the outline joins back MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `GeoDrawer.draw(_ bounds:in:)` built the bezier outline path with `move` + a series of `addLine` calls but never called `closeSubpath()`, so the last vertex never connected back to the first when stroked. On Danseiji projections (whose edge polygon vertices are dense and asymmetric) this showed up as a visible gap at the polygon's start/end seam. The SVG renderer already closes the path with `Z`, so it didn't have the bug — only the Core Graphics path did. Add a `closeSubpath()` to match. Co-Authored-By: Claude Opus 4.7 --- Sources/GeoDrawer/GeoDrawer+CoreGraphics.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sources/GeoDrawer/GeoDrawer+CoreGraphics.swift b/Sources/GeoDrawer/GeoDrawer+CoreGraphics.swift index a64faac..788552a 100644 --- a/Sources/GeoDrawer/GeoDrawer+CoreGraphics.swift +++ b/Sources/GeoDrawer/GeoDrawer+CoreGraphics.swift @@ -173,6 +173,9 @@ extension GeoDrawer { for point in points[1...] { mutable.addLine(to: point.cgPoint) } + // Close the ring so the stroke joins the last vertex back to the + // first — otherwise there's a visible gap on Danseiji outlines. + mutable.closeSubpath() path = mutable }