mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 05:05:20 -05:00
Handle text scrolling in RTL.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23021 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
d7cdd08664
commit
2282607224
1 changed files with 5 additions and 4 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue