README: fix a type error in Offseting Paths example

Before this commit the `t = k / steps` math is done with integers,
which always results in `t = 0`.

This commit forces the math to be done with floating-point numbers,
which results in the progression of `t` values we want.
pull/34/head
Sebastian Kuzminsky 2017-12-18 00:07:26 -07:00
parent b54bf778b4
commit 8c93eb0f2f
1 changed files with 1 additions and 1 deletions

View File

@ -587,7 +587,7 @@ curve <https://en.wikipedia.org/wiki/Parallel_curve>`__ for a few paths.
for seg in path:
ct = 1
for k in range(steps):
t = k / steps
t = k / float(steps)
offset_vector = offset_distance * seg.normal(t)
nl = Line(seg.point(t), seg.point(t) + offset_vector)
nls.append(nl)