summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2013-12-15 23:41:24 +0100
committerDavid Lamparter <equinox@diac24.net>2013-12-15 23:41:24 +0100
commit1e5074b52e4bb29c9cc1574929d9e8c681b2ae0e (patch)
tree7ddf10eab97543795437807c9e7826847b7ca334
parent0516ad0b6adc3f53e62746177788ac79f1b1ada2 (diff)
improve text layout stuff
-rw-r--r--ptlayout.py9
1 files 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)