summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMohamed Tarek <mt@rockbox.org>2009-10-09 00:56:37 +0000
committerMohamed Tarek <mt@rockbox.org>2009-10-09 00:56:37 +0000
commit228260722489d0c665dd025e61af053b0247d99d (patch)
treeb1fd5b41e6a0c63a0be76143f89479465e6b09fc
parentd7cdd0866495ad9605615bd18d09629880633e76 (diff)
downloadrockbox-228260722489d0c665dd025e61af053b0247d99d.tar.gz
rockbox-228260722489d0c665dd025e61af053b0247d99d.zip
Handle text scrolling in RTL.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23021 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/drivers/lcd-bitmap-common.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/firmware/drivers/lcd-bitmap-common.c b/firmware/drivers/lcd-bitmap-common.c
index b4bc11c706..9d5c78b905 100644
--- a/firmware/drivers/lcd-bitmap-common.c
+++ b/firmware/drivers/lcd-bitmap-common.c
@@ -302,7 +302,8 @@ void LCDFN(scroll_fn)(void)
LCDFN(set_viewport)(s->vp);
- if (s->backward)
+ if (s->backward ^ VP_IS_RTL(current_vp))
+ /* contrary to LTR, this is "forward" in RTL */
s->offset -= LCDFN(scroll_info).step;
else
s->offset += LCDFN(scroll_info).step;
@@ -312,13 +313,13 @@ void LCDFN(scroll_fn)(void)
ypos = s->y * pf->height;
if (s->bidir) { /* scroll bidirectional */
- if (s->offset <= 0) {
+ if (abs(s->offset) <= 0) {
/* at beginning of line */
s->offset = 0;
s->backward = false;
s->start_tick = current_tick + LCDFN(scroll_info).delay * 2;
}
- if (s->offset >= s->width - (current_vp->width - xpos)) {
+ if (abs(s->offset) >= s->width - (current_vp->width - xpos)) {
/* at end of line */
s->offset = s->width - (current_vp->width - xpos);
s->backward = true;
@@ -327,7 +328,7 @@ void LCDFN(scroll_fn)(void)
}
else {
/* scroll forward the whole time */
- if (s->offset >= s->width)
+ if (abs(s->offset) >= s->width)
s->offset %= s->width;
}
LCDFN(putsxyofs_style)(xpos, ypos, s->line, s->style, s->width,