Fix implementation of points() (#155)

fix incorrect implementation of `points`  method
pull/158/head
Julian Rüth 2021-09-27 03:22:09 +02:00 committed by GitHub
parent e4c7b53f62
commit 39d3ba713f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -637,7 +637,7 @@ class Line(object):
def points(self, ts): def points(self, ts):
"""Faster than running Path.point many times.""" """Faster than running Path.point many times."""
return self.poly(ts) return self.poly()(ts)
def length(self, t0=0, t1=1, error=None, min_depth=None): def length(self, t0=0, t1=1, error=None, min_depth=None):
"""returns the length of the line segment between t0 and t1.""" """returns the length of the line segment between t0 and t1."""
@ -914,7 +914,7 @@ class QuadraticBezier(object):
def points(self, ts): def points(self, ts):
"""Faster than running Path.point many times.""" """Faster than running Path.point many times."""
return self.poly(ts) return self.poly()(ts)
def length(self, t0=0, t1=1, error=None, min_depth=None): def length(self, t0=0, t1=1, error=None, min_depth=None):
if t0 == 1 and t1 == 0: if t0 == 1 and t1 == 0:
@ -1178,7 +1178,7 @@ class CubicBezier(object):
def points(self, ts): def points(self, ts):
"""Faster than running Path.point many times.""" """Faster than running Path.point many times."""
return self.poly(ts) return self.poly()(ts)
def length(self, t0=0, t1=1, error=LENGTH_ERROR, min_depth=LENGTH_MIN_DEPTH): def length(self, t0=0, t1=1, error=LENGTH_ERROR, min_depth=LENGTH_MIN_DEPTH):
"""Calculate the length of the path up to a certain position""" """Calculate the length of the path up to a certain position"""