From 496b38bf97549dda2cd2fb27f461bc1e233d83f3 Mon Sep 17 00:00:00 2001 From: dmullis Date: Tue, 20 Feb 2024 13:05:11 -0800 Subject: [PATCH] Fix blampe issue #25: "Rendering in close corners" For result, see examples/small-grids.svg https://github.com/blampe/goat/issues/25 --- examples/complicated.svg | 1 - examples/small-grids.svg | 4 ---- parse-graphics.go | 6 ++++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/examples/complicated.svg b/examples/complicated.svg index 1fe43b0..7d33bc2 100644 --- a/examples/complicated.svg +++ b/examples/complicated.svg @@ -141,7 +141,6 @@ path { - diff --git a/examples/small-grids.svg b/examples/small-grids.svg index 2518b1d..62bbb6a 100644 --- a/examples/small-grids.svg +++ b/examples/small-grids.svg @@ -124,16 +124,12 @@ path { - - - - diff --git a/parse-graphics.go b/parse-graphics.go index 7969f94..568676b 100644 --- a/parse-graphics.go +++ b/parse-graphics.go @@ -415,10 +415,12 @@ func (c *Canvas) getLines( currentLine = snip(currentLine) } - // Don't connect o to o, + to o, etc. This character is a new pass-through + // Don't connect o to o, + to o, "'" to ".". This character is a new pass-through // so we still want to respect shouldKeep; we just don't want to draw // the existing line through this cell. - if justPassedThrough && (isDot || isTriangle) { + // + // XX The "'" to "." issue arises with o==S, only: split out as such? + if justPassedThrough && (isDot || isTriangle || r == '.') { currentLine = snip(currentLine) }