summaryrefslogtreecommitdiff
path: root/apps/plugins/lib/grey_scroll.c
diff options
context:
space:
mode:
authorTorne Wuff <torne@wolfpuppy.org.uk>2009-10-16 20:15:12 +0000
committerTorne Wuff <torne@wolfpuppy.org.uk>2009-10-16 20:15:12 +0000
commit27ece8c366b89fab05a47c342edc3edc18a6c5e3 (patch)
tree6731c6beeb67dfb6d10cb35322c41e859c48b6ea /apps/plugins/lib/grey_scroll.c
parenta3f0a45c0f80b34310fffcce339d151365845c61 (diff)
downloadrockbox-27ece8c366b89fab05a47c342edc3edc18a6c5e3.zip
rockbox-27ece8c366b89fab05a47c342edc3edc18a6c5e3.tar.gz
rockbox-27ece8c366b89fab05a47c342edc3edc18a6c5e3.tar.bz2
rockbox-27ece8c366b89fab05a47c342edc3edc18a6c5e3.tar.xz
Pluginlib: make scroll functions clear screen if scrolled by >= screen size (from FS#10330)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23211 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/lib/grey_scroll.c')
-rw-r--r--apps/plugins/lib/grey_scroll.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/apps/plugins/lib/grey_scroll.c b/apps/plugins/lib/grey_scroll.c
index adecd3b..35f73b7 100644
--- a/apps/plugins/lib/grey_scroll.c
+++ b/apps/plugins/lib/grey_scroll.c
@@ -37,7 +37,10 @@ void grey_scroll_left(int count)
int length, blank;
if ((unsigned)count >= (unsigned)_grey_info.width)
+ {
+ grey_clear_display();
return;
+ }
data = _grey_info.buffer;
data_end = data + _GREY_MULUQ(_grey_info.width, _grey_info.height);
@@ -62,7 +65,10 @@ void grey_scroll_right(int count)
int length, blank;
if ((unsigned)count >= (unsigned)_grey_info.width)
+ {
+ grey_clear_display();
return;
+ }
data = _grey_info.buffer;
data_end = data + _GREY_MULUQ(_grey_info.width, _grey_info.height);
@@ -86,7 +92,10 @@ void grey_scroll_up(int count)
int blank;
if ((unsigned)count >= (unsigned)_grey_info.height)
+ {
+ grey_clear_display();
return;
+ }
shift = _GREY_MULUQ(_grey_info.width, count);
length = _GREY_MULUQ(_grey_info.width, _grey_info.height - count);
@@ -105,7 +114,10 @@ void grey_scroll_down(int count)
int blank;
if ((unsigned)count >= (unsigned)_grey_info.height)
+ {
+ grey_clear_display();
return;
+ }
shift = _GREY_MULUQ(_grey_info.width, count);
length = _GREY_MULUQ(_grey_info.width, _grey_info.height - count);
@@ -126,7 +138,10 @@ void grey_ub_scroll_left(int count)
int blank, length;
if ((unsigned)count >= (unsigned)_grey_info.width)
+ {
+ grey_ub_clear_display();
return;
+ }
data = _grey_info.values;
data_end = data + _GREY_MULUQ(_grey_info.width, _grey_info.height);
@@ -156,7 +171,10 @@ void grey_ub_scroll_right(int count)
int blank, length;
if ((unsigned)count >= (unsigned)_grey_info.width)
+ {
+ grey_ub_clear_display();
return;
+ }
data = _grey_info.values;
data_end = data + _GREY_MULUQ(_grey_info.width, _grey_info.height);
@@ -185,7 +203,10 @@ void grey_ub_scroll_up(int count)
int blank;
if ((unsigned)count >= (unsigned)_grey_info.height)
+ {
+ grey_ub_clear_display();
return;
+ }
dst = _grey_info.values;
end = dst + _GREY_MULUQ(_grey_info.height, _grey_info.width);
@@ -257,7 +278,10 @@ void grey_ub_scroll_down(int count)
int blank;
if ((unsigned)count >= (unsigned)_grey_info.height)
+ {
+ grey_ub_clear_display();
return;
+ }
start = _grey_info.values;
dst = start + _GREY_MULUQ(_grey_info.height, _grey_info.width);