From 91bfc2ca89c16bbf7c30664e0a393fb46b274ed3 Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Fri, 23 Sep 2016 18:03:57 -0700 Subject: [PATCH] Choose a consistent starting point for rings with no shared edges --- tile.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tile.cpp b/tile.cpp index ad4f67e4..25520e93 100644 --- a/tile.cpp +++ b/tile.cpp @@ -716,6 +716,7 @@ void find_common_edges(std::vector &partials) { for (size_t k = 0; k < g.size(); k++) { if (g[k].op == VT_MOVETO) { ssize_t necessary = -1; + ssize_t lowest = k; size_t l; for (l = k + 1; l < g.size(); l++) { if (g[l].op != VT_LINETO) { @@ -725,6 +726,13 @@ void find_common_edges(std::vector &partials) { if (g[l].necessary) { necessary = l; } + if (g[l] < g[lowest]) { + lowest = l; + } + } + + if (necessary < 0) { + necessary = lowest; } if (necessary >= 0) {