From 1cf3086cf6dabee2df995afd2d739991ddcc047d Mon Sep 17 00:00:00 2001
From: XANTRONIX Industrial <xan@xantronix.com>
Date: Mon, 24 Mar 2025 13:46:29 -0400
Subject: [PATCH] This seems more correct

---
 lib/xmet/geo.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/xmet/geo.py b/lib/xmet/geo.py
index 1598fde..85b1df7 100644
--- a/lib/xmet/geo.py
+++ b/lib/xmet/geo.py
@@ -102,6 +102,11 @@ class PolygonBuilder():
         Yield the single point to the caller, while maintaining state of
         number of points yielded to the caller.
         """
+        if self.point_first is None:
+            self.point_first = point
+
+        self.point_last = point
+
         self.point_last = point
 
         yield point
@@ -126,11 +131,6 @@ class PolygonBuilder():
         last = None
 
         for point in self.sequence:
-            if self.point_first is None:
-                self.point_first = point
-
-            self.point_last = point
-
             if last is None:
                 last = point
                 continue