diff options
author | Christian Franke <nobody@nowhere.ws> | 2013-12-22 10:50:31 +0100 |
---|---|---|
committer | Christian Franke <nobody@nowhere.ws> | 2013-12-22 10:50:31 +0100 |
commit | 5f03783f6601854fc8fd2e769b02f81e1a4c3b7a (patch) | |
tree | 33a107b70acc6ecab50389ff94f261e77973ff19 | |
parent | 58135d49bfd435ea08713adee5f8179913bbae10 (diff) |
Add support to rotate layers
-rw-r--r-- | read_layers.py | 2 |
1 files changed, 2 insertions, 0 deletions
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 |