graphics/rotate: support 2 member for origin in Rotate constructor. closes #1671

This commit is contained in:
Mathieu Virbel 2013-12-07 12:59:06 +01:00
parent 0eb61594f8
commit 0625e42d72
1 changed files with 7 additions and 1 deletions

View File

@ -584,7 +584,13 @@ cdef class Rotate(Transform):
if 'angle' in kwargs:
self._angle = kwargs['angle']
if 'origin' in kwargs:
self._origin = kwargs['origin']
origin = kwargs['origin']
if len(origin) == 3:
self._origin = tuple(origin)
elif len(origin) == 2:
self._origin = (origin[0], origin[1], 0.)
else:
raise Exception('invalid number of components in origin')
self.compute()