summaryrefslogtreecommitdiff
path: root/gerbonara/cad/kicad/base_types.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2023-07-20 16:56:20 +0200
committerjaseg <git@jaseg.de>2023-07-20 16:56:20 +0200
commit60674ab5b3a76e325336905586b35916660e4472 (patch)
tree88a1ae6de1d6c6f2b6ed5a5106a1e2401d258b5d /gerbonara/cad/kicad/base_types.py
parentbdbdf7f58607bb98999e17ace8a743267a06cd9d (diff)
downloadgerbonara-60674ab5b3a76e325336905586b35916660e4472.tar.gz
gerbonara-60674ab5b3a76e325336905586b35916660e4472.tar.bz2
gerbonara-60674ab5b3a76e325336905586b35916660e4472.zip
Fix line rendering
Diffstat (limited to 'gerbonara/cad/kicad/base_types.py')
-rw-r--r--gerbonara/cad/kicad/base_types.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/gerbonara/cad/kicad/base_types.py b/gerbonara/cad/kicad/base_types.py
index 263f19d..9acef7b 100644
--- a/gerbonara/cad/kicad/base_types.py
+++ b/gerbonara/cad/kicad/base_types.py
@@ -96,7 +96,7 @@ class Stroke:
class Dasher:
def __init__(self, obj):
if obj.stroke:
- w, t = obj.stroke.width, obj.stroke.type
+ w, t = obj.stroke.width or 0.254, obj.stroke.type
else:
w = obj.width or 0
t = Atom.solid
@@ -150,7 +150,6 @@ class Dasher:
for length, stroked in cycle(zip(self.pattern, cycle([True, False]))):
length = max(1e-12, length)
- import sys
while length > 0:
if segment_remaining == 0:
try:
@@ -312,7 +311,7 @@ class TextMixin:
def to_svg(self, color='black'):
d = ' '.join(self.svg_path_data())
- yield Tag('path', d=d, fill='none', stroke=color, stroke_width=f'{self.line_width:.3f}')
+ yield Tag('path', d=d, fill='none', stroke=color, stroke_width=f'{self.line_width:.3f}', stroke_linecap='round')
def render(self, variables={}):
if not self.effects or self.effects.hide or not self.effects.font: