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

don't add transforms in shape_element() if not necessary #34

Merged
merged 2 commits into from May 23, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion gizeh/gizeh.py
Expand Up @@ -437,7 +437,14 @@ def new_draw(ctx):
_set_source(ctx, stroke)
ctx.stroke_preserve()

return Element(new_draw).rotate(angle).translate(xy)
if angle == 0 and xy == (0,0):
return Element(new_draw)
elif angle == 0:
return Element(new_draw).translate(xy)
elif xy == (0,0)
return Element(new_draw).rotate(angle)
else:
return Element(new_draw).rotate(angle).translate(xy)


def rectangle(lx, ly, **kw):
Expand Down