Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed SvgPath_getDimension() behaviour for multiple sub-paths #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions pcbmode/utils/svgpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,9 @@ def _getDimensions(self, path):
"""
"""

last_point = Point()
abs_point = Point()

patho = Point()

bbox_top_left = Point()
bbox_bot_right = Point()

Expand Down Expand Up @@ -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]):

Expand Down Expand Up @@ -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]))
Expand Down