From 27ece8c366b89fab05a47c342edc3edc18a6c5e3 Mon Sep 17 00:00:00 2001 From: Torne Wuff Date: Fri, 16 Oct 2009 20:15:12 +0000 Subject: 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 --- apps/plugins/lib/xlcd_scroll.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'apps/plugins/lib/xlcd_scroll.c') diff --git a/apps/plugins/lib/xlcd_scroll.c b/apps/plugins/lib/xlcd_scroll.c index 96e0715894..f8eac1d4b9 100644 --- a/apps/plugins/lib/xlcd_scroll.c +++ b/apps/plugins/lib/xlcd_scroll.c @@ -37,7 +37,10 @@ void xlcd_scroll_left(int count) int length, oldmode; if ((unsigned)count >= LCD_WIDTH) + { + rb->lcd_clear_display(); return; + } length = (LCD_WIDTH-count)*LCD_FBHEIGHT; @@ -56,7 +59,10 @@ void xlcd_scroll_right(int count) int length, oldmode; if ((unsigned)count >= LCD_WIDTH) + { + rb->lcd_clear_display(); return; + } length = (LCD_WIDTH-count)*LCD_FBHEIGHT; @@ -77,7 +83,10 @@ void xlcd_scroll_up(int count) fb_data *data; if ((unsigned)count >= LCD_HEIGHT) + { + rb->lcd_clear_display(); return; + } length = LCD_HEIGHT - count; @@ -103,7 +112,10 @@ void xlcd_scroll_down(int count) fb_data *data; if ((unsigned)count >= LCD_HEIGHT) + { + rb->lcd_clear_display(); return; + } length = LCD_HEIGHT - count; @@ -131,7 +143,10 @@ void xlcd_scroll_left(int count) int blockcount, blocklen; if ((unsigned) count >= LCD_WIDTH) + { + rb->lcd_clear_display(); return; + } #if LCD_DEPTH == 2 blockcount = count >> 2; @@ -186,7 +201,10 @@ void xlcd_scroll_right(int count) int blockcount, blocklen; if ((unsigned) count >= LCD_WIDTH) + { + rb->lcd_clear_display(); return; + } #if LCD_DEPTH == 2 blockcount = count >> 2; @@ -243,7 +261,10 @@ void xlcd_scroll_left(int count) int length, oldmode; if ((unsigned)count >= LCD_WIDTH) + { + rb->lcd_clear_display(); return; + } data = rb->lcd_framebuffer; data_end = data + LCD_WIDTH*LCD_FBHEIGHT; @@ -269,7 +290,10 @@ void xlcd_scroll_right(int count) int length, oldmode; if ((unsigned)count >= LCD_WIDTH) + { + rb->lcd_clear_display(); return; + } data = rb->lcd_framebuffer; data_end = data + LCD_WIDTH*LCD_FBHEIGHT; @@ -298,7 +322,10 @@ void xlcd_scroll_up(int count) int length, oldmode; if ((unsigned)count >= LCD_HEIGHT) + { + rb->lcd_clear_display(); return; + } length = LCD_HEIGHT - count; @@ -318,7 +345,10 @@ void xlcd_scroll_down(int count) int length, oldmode; if ((unsigned)count >= LCD_HEIGHT) + { + rb->lcd_clear_display(); return; + } length = LCD_HEIGHT - count; @@ -342,7 +372,10 @@ void xlcd_scroll_up(int count) int blockcount, blocklen; if ((unsigned) count >= LCD_HEIGHT) + { + rb->lcd_clear_display(); return; + } #if (LCD_DEPTH == 1) \ || (LCD_DEPTH == 2) && (LCD_PIXELFORMAT == VERTICAL_INTERLEAVED) @@ -536,7 +569,10 @@ void xlcd_scroll_down(int count) int blockcount, blocklen; if ((unsigned) count >= LCD_HEIGHT) + { + rb->lcd_clear_display(); return; + } #if (LCD_DEPTH == 1) \ || (LCD_DEPTH == 2) && (LCD_PIXELFORMAT == VERTICAL_INTERLEAVED) -- cgit v1.2.3