diff options
author | jaseg <git@jaseg.de> | 2023-04-04 20:06:16 +0200 |
---|---|---|
committer | jaseg <git@jaseg.de> | 2023-04-10 23:57:15 +0200 |
commit | 44ca8349ebfef90b363ea765af44f5d6261778fe (patch) | |
tree | cf084aab6c8106ddd28279373bec2f4b235aa3cc /gerbonara/graphic_primitives.py | |
parent | ce8d0451787f3aaa3b0a83e24f0bce7f2a55c62a (diff) | |
download | gerbonara-44ca8349ebfef90b363ea765af44f5d6261778fe.tar.gz gerbonara-44ca8349ebfef90b363ea765af44f5d6261778fe.tar.bz2 gerbonara-44ca8349ebfef90b363ea765af44f5d6261778fe.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 |