diff options
author | jaseg <git@jaseg.de> | 2023-04-04 19:06:04 +0200 |
---|---|---|
committer | jaseg <git@jaseg.de> | 2023-04-10 23:57:15 +0200 |
commit | 07b2628dbb08de7120ef3c760cd91f0d8901fe73 (patch) | |
tree | b640afbcf0da447185e72f572e373149f4aff079 /gerbonara/graphic_primitives.py | |
parent | 387ff3de76664e620afebb6dabbccc0424710546 (diff) | |
download | gerbonara-07b2628dbb08de7120ef3c760cd91f0d8901fe73.tar.gz gerbonara-07b2628dbb08de7120ef3c760cd91f0d8901fe73.tar.bz2 gerbonara-07b2628dbb08de7120ef3c760cd91f0d8901fe73.zip |
Various convenience improvements, and make board name guessing really smart
Diffstat (limited to 'gerbonara/graphic_primitives.py')
-rw-r--r-- | gerbonara/graphic_primitives.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gerbonara/graphic_primitives.py b/gerbonara/graphic_primitives.py index 1cfebbb..27890b1 100644 --- a/gerbonara/graphic_primitives.py +++ b/gerbonara/graphic_primitives.py @@ -188,7 +188,7 @@ class Line(GraphicPrimitive): def to_svg(self, fg='black', bg='white', tag=Tag): color = fg if self.polarity_dark else bg width = f'{self.width:.6}' if not math.isclose(self.width, 0) else '0.01mm' - return tag('path', d=f'M {self.x1:.6} {self.y1:.6} L {self.x2:.6} {self.y2:.6}', + return tag('path', d=f'M {float(self.x1):.6} {float(self.y1):.6} L {float(self.x2):.6} {float(self.y2):.6}', style=f'fill: none; stroke: {color}; stroke-width: {width}; stroke-linecap: round') @dataclass(frozen=True) @@ -240,7 +240,7 @@ class Arc(GraphicPrimitive): color = fg if self.polarity_dark else bg arc = svg_arc((self.x1, self.y1), (self.x2, self.y2), (self.cx, self.cy), self.clockwise) width = f'{self.width:.6}' if not math.isclose(self.width, 0) else '0.01mm' - return tag('path', d=f'M {self.x1:.6} {self.y1:.6} {arc}', + return tag('path', d=f'M {float(self.x1):.6} {float(self.y1):.6} {arc}', style=f'fill: none; stroke: {color}; stroke-width: {width}; stroke-linecap: round; fill: none') @dataclass(frozen=True) |