From 0625e42d72c80241a0363eaddb97fd68c26194ce Mon Sep 17 00:00:00 2001 From: Mathieu Virbel Date: Sat, 7 Dec 2013 12:59:06 +0100 Subject: [PATCH] graphics/rotate: support 2 member for origin in Rotate constructor. closes #1671 --- kivy/graphics/context_instructions.pyx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kivy/graphics/context_instructions.pyx b/kivy/graphics/context_instructions.pyx index bd2a7f2f1..0b047c9d6 100644 --- a/kivy/graphics/context_instructions.pyx +++ b/kivy/graphics/context_instructions.pyx @@ -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()