correct code format (indent)

git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@860 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
This commit is contained in:
michux
2008-03-03 17:03:00 +00:00
parent 2af7a92454
commit 4e6b809f54
5 changed files with 185 additions and 184 deletions

View File

@@ -96,41 +96,38 @@ void widget_text_scroll(void *Self)
T->scroll++;
if (T->scroll >= width + len)
T->scroll = 0;
break;
break;
case ALIGN_PINGPONG:
#define PINGPONGWAIT 2
/* scrolling is not necessary - center the string */
if (len <= width) {
pad = (width - len) / 2;
}
else {
} else {
if (T->direction == 1)
T->scroll++; /* scroll right */
T->scroll++; /* scroll right */
else
T->scroll--; /* scroll left */
/*pad = if positive, add leading space characters, else offset of string begin */
pad = 0-T->scroll;
if (pad < 0-(len-width)) {
T->scroll--; /* scroll left */
/*pad = if positive, add leading space characters, else offset of string begin */
pad = 0 - T->scroll;
if (pad < 0 - (len - width)) {
if (T->delay-- < 1) { /* wait before switch direction */
T->direction = 0; /* change scroll direction */
T->delay = PINGPONGWAIT;
T->scroll -= PINGPONGWAIT;
} /* else debug("wait1"); */
pad = 0-(len-width);
}
else
if (pad > 0) {
} /* else debug("wait1"); */
pad = 0 - (len - width);
} else if (pad > 0) {
if (T->delay-- < 1) {
T->direction = 1;
T->delay = PINGPONGWAIT;
T->scroll += PINGPONGWAIT;
} /* else debug("wait2"); */
} /* else debug("wait2"); */
pad = 0;
}
}
break;
default: /* not reached */
@@ -256,12 +253,12 @@ void widget_text_update(void *Self)
/* something has changed and should be updated */
if (update) {
/* reset marquee counter if content has changed */
/* reset marquee counter if content has changed */
T->scroll = 0;
/* Init pingpong scroller. start scrolling left (wrong way) to get a delay */
if (T->align == ALIGN_PINGPONG) {
T->direction = 0;
T->direction = 0;
T->delay = PINGPONGWAIT;
}
/* if there's a marquee scroller active, it has its own */
@@ -332,7 +329,7 @@ int widget_text_init(WIDGET * Self)
break;
case 'P':
Text->align = ALIGN_PINGPONG;
break;
break;
default:
error("widget %s has unknown alignment '%s', using 'Left'", section, c);
Text->align = ALIGN_LEFT;