From 6378a91f3614c5258c0037eb4eb1f28d160ed346 Mon Sep 17 00:00:00 2001 From: jaseg Date: Thu, 6 Apr 2023 16:27:57 +0200 Subject: Make generated pretty SVGs smaller --- gerbonara/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gerbonara/utils.py') diff --git a/gerbonara/utils.py b/gerbonara/utils.py index ce5425a..e33a7bf 100644 --- a/gerbonara/utils.py +++ b/gerbonara/utils.py @@ -461,7 +461,10 @@ def svg_arc(old, new, center, clockwise): def svg_rotation(angle_rad, cx=0, cy=0): - return f'rotate({float(math.degrees(angle_rad)):.4} {float(cx):.6} {float(cy):.6})' + if math.isclose(angle_rad, 0.0, abs_tol=1e-3): + return {} + else: + return {'transform': f'rotate({float(math.degrees(angle_rad)):.4} {float(cx):.6} {float(cy):.6})'} def setup_svg(tags, bounds, margin=0, arg_unit=MM, svg_unit=MM, pagecolor='white', tag=Tag, inkscape=False): (min_x, min_y), (max_x, max_y) = bounds -- cgit