From 4d0c0fd01fa054c8ec5fe57c16fa42599df6efea Mon Sep 17 00:00:00 2001 From: Hopiu Date: Thu, 5 Jan 2017 22:27:23 +0100 Subject: [PATCH] try to understand how to rotate painting on the canvas --- python/rgbmatrix/core.pyx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/rgbmatrix/core.pyx b/python/rgbmatrix/core.pyx index 3732ada..c44aa0d 100644 --- a/python/rgbmatrix/core.pyx +++ b/python/rgbmatrix/core.pyx @@ -40,6 +40,9 @@ cdef class FrameCanvas(Canvas): def SetPixel(self, int x, int y, uint8_t red, uint8_t green, uint8_t blue): (self.__getCanvas()).SetPixel(x, y, red, green, blue) + def SetRotatedPixel(self, int x, int y, uint8_t red, uint8_t green, uint8_t blue): + (self.__getCanvas()).SetPixel(self.width - x - 1, self.height - y - 1, red, green, blue) + property width: def __get__(self): return (self.__getCanvas()).width()