Corrected wrongly deleted docstring line

pull/21/head
Juan Pablo Contreras Franco 2017-04-23 07:50:43 +02:00
parent 2a24cf640d
commit 216965e6ab
1 changed files with 4 additions and 3 deletions

View File

@ -11,7 +11,7 @@ from .parser import parse_path
def polyline2pathd(polyline_d): def polyline2pathd(polyline_d):
"""converts the string from a polyline points-attribute to a string for a """converts the string from a polyline points-attribute to a string for a
Path object d-attribute""" Path object d-attribute"""
points = polyline_d.replace(', ', ',') points = polyline_d.replace(', ', ',')
points = points.replace(' ,', ',') points = points.replace(' ,', ',')
@ -55,8 +55,9 @@ def ellipse2pathd(ellipse):
def polygon2pathd(polyline_d): def polygon2pathd(polyline_d):
"""converts the string from a polygon points-attribute to a string for a
Path object d-attribute. Path object d-attribute.
Note: For a polygon made from n points, the resulting path will be Note: For a polygon made from n points, the resulting path will be
composed of n lines (even if some of these lines have length zero).""" composed of n lines (even if some of these lines have length zero)."""
points = polyline_d.replace(', ', ',') points = polyline_d.replace(', ', ',')
points = points.replace(' ,', ',') points = points.replace(' ,', ',')
@ -67,7 +68,7 @@ def polygon2pathd(polyline_d):
d = 'M' + points[0].replace(',', ' ') d = 'M' + points[0].replace(',', ' ')
for p in points[1:]: for p in points[1:]:
d += 'L' + p.replace(',', ' ') d += 'L' + p.replace(',', ' ')
# The `parse_path` call ignores redundant 'z' (closure) commands # The `parse_path` call ignores redundant 'z' (closure) commands
# e.g. `parse_path('M0 0L100 100Z') == parse_path('M0 0L100 100L0 0Z')` # e.g. `parse_path('M0 0L100 100Z') == parse_path('M0 0L100 100L0 0Z')`
# This check ensures that an n-point polygon is converted to an n-Line path. # This check ensures that an n-point polygon is converted to an n-Line path.