From bf5a2968e227af90c9742a585939583f5d3da738 Mon Sep 17 00:00:00 2001
From: jaseg <git@jaseg.de>
Date: Sat, 22 Jan 2022 20:51:22 +0100
Subject: Fix a bunch of bugs

---
 gerbonara/gerber/aperture_macros/parse.py     | 2 +-
 gerbonara/gerber/aperture_macros/primitive.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

(limited to 'gerbonara/gerber/aperture_macros')

diff --git a/gerbonara/gerber/aperture_macros/parse.py b/gerbonara/gerber/aperture_macros/parse.py
index c1aa2d0..2126e0f 100644
--- a/gerbonara/gerber/aperture_macros/parse.py
+++ b/gerbonara/gerber/aperture_macros/parse.py
@@ -94,7 +94,7 @@ class ApertureMacro:
         return f'<Aperture macro, variables {str(self.variables)}, primitives {self.primitives}>'
 
     def __eq__(self, other):
-        return hasattr(other, to_gerber) and self.to_gerber() == other.to_gerber()
+        return hasattr(other, 'to_gerber') and self.to_gerber() == other.to_gerber()
 
     def __hash__(self):
         return hash(self.to_gerber())
diff --git a/gerbonara/gerber/aperture_macros/primitive.py b/gerbonara/gerber/aperture_macros/primitive.py
index 76268d2..7832960 100644
--- a/gerbonara/gerber/aperture_macros/primitive.py
+++ b/gerbonara/gerber/aperture_macros/primitive.py
@@ -223,7 +223,7 @@ class Outline(Primitive):
         self.coords = [(UnitExpression(x, unit), UnitExpression(y, unit)) for x, y in zip(args[1::2], args[2::2])]
 
     def to_gerber(self, unit=None):
-        coords = ','.join(coord.to_gerber(unit) for coord in self.coords)
+        coords = ','.join(coord.to_gerber(unit) for xy in self.coords for coord in xy)
         return f'{self.code},{self.exposure.to_gerber()},{len(self.coords)//2-1},{coords},{self.rotation.to_gerber()}'
 
     def to_graphic_primitives(self, offset, rotation, variable_binding={}, unit=None):
-- 
cgit