From 1e5074b52e4bb29c9cc1574929d9e8c681b2ae0e Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Sun, 15 Dec 2013 23:41:24 +0100 Subject: improve text layout stuff --- ptlayout.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ptlayout.py b/ptlayout.py index 0850c62..2ead50c 100644 --- a/ptlayout.py +++ b/ptlayout.py @@ -58,14 +58,19 @@ class PTLText(PTLayoutElem): w = size[0] matrix = cctx.get_matrix() - if self.mode == 'left': + if self.mode == 'right': cctx.rotate(90. * pi / 180.) cctx.translate((h - size[0]) / 2, -size[1]) w = size[1] - elif self.mode == 'right': + elif self.mode == 'left': cctx.rotate(-90. * pi / 180.) cctx.translate(-h + (h - size[0]) / 2, 0) w = size[1] + elif self.mode == 'down': + cctx.rotate(pi) + cctx.translate(-size[0], -(h + size[1]) / 2) + else: + cctx.translate(0, (h - size[1]) / 2) pctx.update_layout(layout) pctx.show_layout(layout) -- cgit v1.2.1