Align the whole text area as well
authorJoachim Breitner <mail@joachim-breitner.de>
Sun, 10 Feb 2013 22:03:44 +0000 (22:03 +0000)
committerJoachim Breitner <mail@joachim-breitner.de>
Sun, 10 Feb 2013 22:03:44 +0000 (22:03 +0000)
sm.c

diff --git a/sm.c b/sm.c
index e4c9d1a..669aba7 100644 (file)
--- a/sm.c
+++ b/sm.c
@@ -169,7 +169,13 @@ static void redraw(GtkWidget *draw, cairo_t *cr, gpointer data) {
                        gdk_cairo_set_source_rgba(cr, &color);
 
 
-                       cairo_translate(cr, w2/2, h2/2);
+                       if (alignment == 1) { // left align
+                               cairo_translate(cr, (s * rw1)/2, h2/2);
+                       } else if (alignment == 2) { // right align
+                               cairo_translate(cr, w2 - (s * rw1)/2, h2/2);
+                       } else {
+                               cairo_translate(cr, w2/2, h2/2);
+                       }
                        cairo_rotate(cr, rotation * M_PI_2);
                        cairo_scale(cr, s, s);
                        cairo_translate(cr, -w1/2, -h1/2);