From 9b1d6e59e0bf3eca5d41b06fd852921688455756 Mon Sep 17 00:00:00 2001 From: Strehlow Date: Wed, 19 Apr 2017 18:14:08 +0200 Subject: [PATCH] _getDimension() now stores path origin and set abspos to it on path close --- pcbmode/utils/svgpath.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pcbmode/utils/svgpath.py b/pcbmode/utils/svgpath.py index 55e24148..48c10959 100644 --- a/pcbmode/utils/svgpath.py +++ b/pcbmode/utils/svgpath.py @@ -390,9 +390,9 @@ def _getDimensions(self, path): """ """ - last_point = Point() abs_point = Point() - + patho = Point() + bbox_top_left = Point() bbox_bot_right = Point() @@ -424,7 +424,9 @@ def _getDimensions(self, path): bbox_top_left, bbox_bot_right = svg.boundary_box_check(bbox_top_left, bbox_bot_right, abs_point) - + #store path origin for the time the (sub)path is closed ('z') + patho = abs_point + # cubic Bezier curve command elif re.match('c', path[i][0]): @@ -607,7 +609,7 @@ def _getDimensions(self, path): # 'close shape' command elif re.match('Z', path[i][0], re.I): - pass + abs_point = patho else: print("ERROR: found an unsupported SVG path command " + str(path[i][0]))