diff options
author | michux <michux@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2008-03-03 17:03:00 +0000 |
---|---|---|
committer | michux <michux@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2008-03-03 17:03:00 +0000 |
commit | 4e6b809f540d17425d59df4cde3dfdab58960b06 (patch) | |
tree | 20f83ae60364c7d8bb389e64777ffa1ed0a18cfa /widget_text.c | |
parent | 2af7a924548b41fddac1216ba5fe78cfc39af98f (diff) | |
download | lcd4linux-4e6b809f540d17425d59df4cde3dfdab58960b06.tar.gz |
correct code format (indent)
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@860 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to 'widget_text.c')
-rw-r--r-- | widget_text.c | 39 |
1 files changed, 18 insertions, 21 deletions
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; |