fixed support for rectangles when no x,y attributes are specified

defaults to 0,0
pull/8/merge
Andy 2017-04-26 02:21:01 -07:00
parent d670547149
commit 38eeac858c
1 changed files with 2 additions and 2 deletions

View File

@ -83,8 +83,8 @@ def rect2pathd(rect):
The rectangle will start at the (x,y) coordinate specified by the rectangle
object and proceed counter-clockwise."""
x0, y0 = rect['x'], rect['y']
w, h = rect["width"], rect["height"]
x0, y0 = float(rect.get('x', 0)), float(rect.get('y', 0))
w, h = float(rect["width"]), float(rect["height"])
x1, y1 = x0 + w, y0
x2, y2 = x0 + w, y0 + h
x3, y3 = x0, y0 + h