diff options
author | Shawn <sabetts@juicebox> | 2008-05-25 00:18:17 -0700 |
---|---|---|
committer | Shawn <sabetts@juicebox> | 2008-05-25 00:18:17 -0700 |
commit | 98503f1fa2abd896c91a186c1f1670932a14ed63 (patch) | |
tree | b9195d9b2a045740709b9db63091a0407b6850be | |
parent | 4be06410d03bcbcde5707e317c321a482cb32214 (diff) | |
download | ratpoison-98503f1fa2abd896c91a186c1f1670932a14ed63.zip |
change -1 to the proper string length in some calls to rp_text_width and rp_draw_string
-rw-r--r-- | src/bar.c | 12 | ||||
-rw-r--r-- | src/split.c | 2 |
2 files changed, 8 insertions, 6 deletions
@@ -262,7 +262,7 @@ max_line_length (char* msg) int current_width; /* Check if this line is the longest so far. */ - current_width = rp_text_width (s, defaults.font, msg + start, -1); + current_width = rp_text_width (s, defaults.font, msg + start, i - start); if(current_width > ret) { ret = current_width; @@ -339,8 +339,9 @@ draw_string (rp_screen *s, char *msg) { rp_draw_string (s, s->bar_window, s->normal_gc, defaults.bar_x_padding, - defaults.bar_y_padding + FONT_ASCENT(s), - msg + start, -1); + defaults.bar_y_padding + FONT_ASCENT(s) + + line_no * line_height, + msg + start, i - start); line_no++; start = i + 1; } @@ -349,8 +350,9 @@ draw_string (rp_screen *s, char *msg) /* Print the last line. */ rp_draw_string (s, s->bar_window, s->normal_gc, defaults.bar_x_padding, - defaults.bar_y_padding + FONT_ASCENT(s), - msg + start, -1); + defaults.bar_y_padding + FONT_ASCENT(s) + + line_no * line_height, + msg + start, strlen (msg) - start); XSync (dpy, False); } diff --git a/src/split.c b/src/split.c index 45671c2..e27e277 100644 --- a/src/split.c +++ b/src/split.c @@ -1021,7 +1021,7 @@ show_frame_message (char *msg) rp_draw_string (s, s->frame_window, s->normal_gc, defaults.bar_x_padding, defaults.bar_y_padding + FONT_ASCENT(s), - msgbuf->data, -1); + msgbuf->data, msgbuf->len); sbuf_free (msgbuf); } |