From 4e6b809f540d17425d59df4cde3dfdab58960b06 Mon Sep 17 00:00:00 2001 From: michux Date: Mon, 3 Mar 2008 17:03:00 +0000 Subject: correct code format (indent) git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@860 3ae390bd-cb1e-0410-b409-cd5a39f66f1f --- widget_text.c | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) (limited to 'widget_text.c') diff --git a/widget_text.c b/widget_text.c index dfcf6dd..948540b 100644 --- a/widget_text.c +++ b/widget_text.c @@ -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; -- cgit v1.2.3