From 8613c64b32ff43f6cb8a5d8d55f93b0088e1a785 Mon Sep 17 00:00:00 2001 From: Florian Festi Date: Thu, 19 Nov 2020 23:23:39 +0100 Subject: [PATCH] Also scale line width This in practise only affects PostScript and derived formats - basically everything except SVG --- boxes/drawing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/boxes/drawing.py b/boxes/drawing.py index 4abcabe..9fec63a 100644 --- a/boxes/drawing.py +++ b/boxes/drawing.py @@ -553,7 +553,7 @@ Creation date: {date} p.pop() if p: # might be empty if only contains text t = ET.SubElement(g, "path", d=" ".join(p), stroke=color) - t.set("stroke-width", f'{path.params["lw"]:.2f}') + t.set("stroke-width", f'{path.params["lw"]*self.scale:.2f}') t.tail = "\n " t.tail = "\n" tree.write(open(self._fname, "wb"), xml_declaration=True, method="xml") @@ -674,7 +674,7 @@ class PSSurface(Surface): f.write("newpath\n") f.write("\n".join(p)) f.write("\n") - f.write(f"{path.params['lw']} setlinewidth\n") + f.write(f"{path.params['lw']*self.scale} setlinewidth\n") f.write(f"{color} setrgbcolor\n") f.write("stroke\n\n") f.write(