Package: gozer / 0.7.nofont.1-5

01-x-offset-justification.diff Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
diff --git a/src/main.c b/src/main.c
index aea4098..fdcf876 100644
--- a/src/main.c
+++ b/src/main.c
@@ -156,13 +156,27 @@ main(int argc, char **argv)
                                opt.fn_r, opt.fn_g, opt.fn_b, opt.fn_a);
            break;
         case JUST_CENTER:
-           x = ((((opt.bg_resize && bgw) ? bgw : w) - ww) / 2);
+           if (opt.x) 
+           {
+              x = (opt.x - ( ww / 2 ));
+           }
+           else
+           {
+              x = ((((opt.bg_resize && bgw) ? bgw : w) - ww) / 2);
+           }
            /* y = ((((opt.bg_resize && bgw) ? bgh : h) - hh) / 2); */
            gib_imlib_text_draw(image, fn, style, x, y, p, IMLIB_TEXT_TO_RIGHT,
                                opt.fn_r, opt.fn_g, opt.fn_b, opt.fn_a);
            break;
         case JUST_RIGHT:
+           if (opt.x) 
+           {
+              x = opt.x - ww;
+           }
+           else
+           {
            x = (((opt.bg_resize && bgw) ? bgw : w) - ww);
+           }
            gib_imlib_text_draw(image, fn, style, x, y, p, IMLIB_TEXT_TO_RIGHT,
                                opt.fn_r, opt.fn_g, opt.fn_b, opt.fn_a);