mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-10 05:35:20 -05:00
Fix a bug in lib display_text.h, which inserts a unwanted blank line
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21881 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
fb63808c55
commit
b018f89049
1 changed files with 5 additions and 6 deletions
|
|
@ -62,16 +62,15 @@ bool display_text(short words, char** text, struct style_text* style,
|
||||||
rb->lcd_getstringsize(" ", &space_w, &height);
|
rb->lcd_getstringsize(" ", &space_w, &height);
|
||||||
for (i = 0; i < words; i++) {
|
for (i = 0; i < words; i++) {
|
||||||
rb->lcd_getstringsize(text[i], &width, NULL);
|
rb->lcd_getstringsize(text[i], &width, NULL);
|
||||||
/* skip to next line if the current one can't fit the word */
|
/* skip to next line if the word is an empty string */
|
||||||
if (x + width > vp_width - MARGIN) {
|
|
||||||
x = MARGIN;
|
|
||||||
y = y + height;
|
|
||||||
}
|
|
||||||
/* .. or if the word is the empty string */
|
|
||||||
if (rb->strcmp(text[i], "")==0) {
|
if (rb->strcmp(text[i], "")==0) {
|
||||||
x = MARGIN;
|
x = MARGIN;
|
||||||
y = y + height;
|
y = y + height;
|
||||||
continue;
|
continue;
|
||||||
|
/* .. or if the current one can't fit the word */
|
||||||
|
} else if (x + width > vp_width - MARGIN) {
|
||||||
|
x = MARGIN;
|
||||||
|
y = y + height;
|
||||||
}
|
}
|
||||||
/* display the remaining text by button click or exit */
|
/* display the remaining text by button click or exit */
|
||||||
if (y + height > vp_height - MARGIN) {
|
if (y + height > vp_height - MARGIN) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue