From 5f03783f6601854fc8fd2e769b02f81e1a4c3b7a Mon Sep 17 00:00:00 2001 From: Christian Franke Date: Sun, 22 Dec 2013 10:50:31 +0100 Subject: Add support to rotate layers --- read_layers.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/read_layers.py b/read_layers.py index 3d10445..0cbda29 100644 --- a/read_layers.py +++ b/read_layers.py @@ -36,6 +36,7 @@ class Layer(object): self._scale = info.get('scale', 1.0) self._x_offset = info.get('x-offset', 0.0) self._y_offset = info.get('y-offset', 0.0) + self._rotate = info.get('rotate', 0.0) self._load_file(path) @@ -50,6 +51,7 @@ class Layer(object): def draw(self, context): context.transform(cairo.Matrix(x0=self._x_offset, y0=self._y_offset)) context.transform(cairo.Matrix(xx=self._scale, yy=self._scale)) + context.transform(cairo.Matrix.init_rotate(self._rotate)) def _load_file(self, path): raise NotImplementedError -- cgit v1.2.1