aboutsummaryrefslogtreecommitdiffstats
path: root/draw.c
diff options
context:
space:
mode:
authorgotmor <gotmor@f2baff5b-bf2c-0410-a398-912abdc3d8b2>2007-07-24 07:13:15 +0000
committergotmor <gotmor@f2baff5b-bf2c-0410-a398-912abdc3d8b2>2007-07-24 07:13:15 +0000
commit1fa1ebd11ca31c993937f59020dd8f5e4fbb842e (patch)
tree7c70d75e479e61a40174428edf1ac786e35cc123 /draw.c
parent9150e80fb95c0cff2e999e361009e9eb5b752d16 (diff)
downloaddzen-1fa1ebd11ca31c993937f59020dd8f5e4fbb842e.tar.gz
dzen-1fa1ebd11ca31c993937f59020dd8f5e4fbb842e.zip
fixed calculating icon location
git-svn-id: http://dzen.googlecode.com/svn/trunk@145 f2baff5b-bf2c-0410-a398-912abdc3d8b2
Diffstat (limited to 'draw.c')
-rw-r--r--draw.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/draw.c b/draw.c
index a2e86ac..5f603d4 100644
--- a/draw.c
+++ b/draw.c
@@ -190,7 +190,8 @@ parse_line(const char *line, int lnr, int align, int reverse, int nodraw) {
/* parse line and render text */
else {
h = dzen.font.ascent + dzen.font.descent;
- xorig = 0; py = dzen.font.ascent + (dzen.line_height - h) / 2;;
+ py = dzen.font.ascent + (dzen.line_height - h) / 2;;
+ xorig = 0;
if(lnr != -1) {
pm = XCreatePixmap(dzen.dpy, RootWindow(dzen.dpy, DefaultScreen(dzen.dpy)), dzen.slave_win.width,
@@ -251,7 +252,8 @@ parse_line(const char *line, int lnr, int align, int reverse, int nodraw) {
&bm_h, &bm, &bm_xh, &bm_yh) == BitmapSuccess)
&& ((h/2 + px + bm_w) < dzen.w)) {
XCopyPlane(dzen.dpy, bm, pm, dzen.tgc,
- 0, 0, bm_w, bm_h, px, 0, 1);
+ 0, 0, bm_w, bm_h, px,
+ dzen.line_height > bm_h ? (dzen.line_height - bm_h)/2 : 0, 1);
XFreePixmap(dzen.dpy, bm);
px += bm_w;
}
@@ -307,7 +309,8 @@ parse_line(const char *line, int lnr, int align, int reverse, int nodraw) {
&bm_h, &bm, &bm_xh, &bm_yh) == BitmapSuccess
&& (h/2 + px + bm_w < dzen.w)) {
XCopyPlane(dzen.dpy, bm, pm, dzen.tgc,
- 0, 0, bm_w, bm_h, px, 0, 1);
+ 0, 0, bm_w, bm_h, px,
+ dzen.line_height > bm_h ? (dzen.line_height - bm_h)/2 : 0, 1);
XFreePixmap(dzen.dpy, bm);
px += bm_w;
}