From 845224e2d6afef782c5d4206fe1a1b503d37583a Mon Sep 17 00:00:00 2001 From: jaseg Date: Fri, 31 Mar 2023 22:31:19 +0200 Subject: Fix failing tests --- gerbonara/rs274x.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gerbonara/rs274x.py') diff --git a/gerbonara/rs274x.py b/gerbonara/rs274x.py index 5ef93dd..6620f10 100644 --- a/gerbonara/rs274x.py +++ b/gerbonara/rs274x.py @@ -544,9 +544,11 @@ class GraphicsState: yield '%LPD*%' if polarity_dark else '%LPC*%' def set_aperture(self, aperture): - if self.aperture != aperture: + ap_id = self.aperture_map[id(aperture)] + old_ap_id = self.aperture_map.get(id(self.aperture), None) + if ap_id != old_ap_id: self.aperture = aperture - yield f'D{self.aperture_map[id(aperture)]}*' + yield f'D{ap_id}*' def set_current_point(self, point, unit=None): point_mm = MM(point[0], unit), MM(point[1], unit) -- cgit