diff options
author | jaseg <git@jaseg.de> | 2023-04-04 20:06:16 +0200 |
---|---|---|
committer | jaseg <git@jaseg.de> | 2023-04-04 20:06:16 +0200 |
commit | 495ae6e93221b38a5347d65aff35effea919a565 (patch) | |
tree | ed376ce0cf29915ebf1424a84ad82c08d29d4f97 /gerbonara/graphic_primitives.py | |
parent | 15867450d930d9a66c3ad1f9694e91d17ba40ee9 (diff) | |
download | gerbonara-495ae6e93221b38a5347d65aff35effea919a565.tar.gz gerbonara-495ae6e93221b38a5347d65aff35effea919a565.tar.bz2 gerbonara-495ae6e93221b38a5347d65aff35effea919a565.zip |
cad: Fix outline reconstruction and add text feature
Diffstat (limited to 'gerbonara/graphic_primitives.py')
-rw-r--r-- | gerbonara/graphic_primitives.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gerbonara/graphic_primitives.py b/gerbonara/graphic_primitives.py index 27890b1..02eac8d 100644 --- a/gerbonara/graphic_primitives.py +++ b/gerbonara/graphic_primitives.py @@ -136,11 +136,11 @@ class ArcPoly(GraphicPrimitive): if len(self.outline) == 0: return - yield f'M {self.outline[0][0]:.6} {self.outline[0][1]:.6}' + yield f'M {float(self.outline[0][0]):.6} {float(self.outline[0][1]):.6}' for old, new, arc in self.segments: if not arc: - yield f'L {new[0]:.6} {new[1]:.6}' + yield f'L {float(new[0]):.6} {float(new[1]):.6}' else: clockwise, center = arc yield svg_arc(old, new, center, clockwise) @@ -214,7 +214,7 @@ class Arc(GraphicPrimitive): def flip(self): return replace(self, x1=self.x2, y1=self.y2, x2=self.x1, y2=self.y1, - cx=(self.x + self.cx) - self.x2, cy=(self.y + self.cy) - self.y2, clockwise=not self.clockwise) + cx=(self.x1 + self.cx) - self.x2, cy=(self.y1 + self.cy) - self.y2, clockwise=not self.clockwise) def bounding_box(self): r = self.width/2 |