]> git.alsa-project.org Git - alsa-utils.git/commitdiff
alsamixer: fix text box clipping with multi-column characters
authorClemens Ladisch <clemens@ladisch.de>
Thu, 28 May 2009 07:16:11 +0000 (09:16 +0200)
committerClemens Ladisch <clemens@ladisch.de>
Thu, 28 May 2009 07:16:11 +0000 (09:16 +0200)
When a multi-column character would straddle the left window border of
a text box, we have to take the inserted space character into account
when we compute how many characters fit into the rest of the line.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
alsamixer/textbox.c

index 7825c152262836e86f9f69dc3e43153c06738c86..d743a146af938ef18b5f598309ccc5601b6d6190 100644 (file)
@@ -166,7 +166,7 @@ static void update_text_lines(void)
                if (width > current_left)
                        waddch(text_widget.window, ' ');
                if (*line_begin != '\0') {
-                       width = text_box_x;
+                       width = text_box_x - (width > current_left);
                        line_end = mbs_at_width(line_begin, &width, -1);
                        if (width)
                                waddnstr(text_widget.window, line_begin,