From 40e98a2e4915464b9306ab7b0f6feb173de095c5 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Mon, 26 Oct 2020 12:38:22 -0400 Subject: Whitespace cleanup on fb_viewport Rewrite Change-Id: I24aac41c8abecf7b78a44d7f59e842b791be4563 --- apps/plugins/lib/xlcd_draw.c | 8 ++++---- apps/plugins/lib/xlcd_scroll.c | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) (limited to 'apps/plugins/lib') diff --git a/apps/plugins/lib/xlcd_draw.c b/apps/plugins/lib/xlcd_draw.c index 0bd1c7a9e2..debdff6f04 100644 --- a/apps/plugins/lib/xlcd_draw.c +++ b/apps/plugins/lib/xlcd_draw.c @@ -356,10 +356,10 @@ void xlcd_gray_bitmap_part(const unsigned char *src, int src_x, int src_y, fb_data *dst; /* nothing to draw? */ - if ((width <= 0) || (height <= 0) || (x >= LCD_WIDTH) || (y >= LCD_HEIGHT) + if ((width <= 0) || (height <= 0) || (x >= LCD_WIDTH) || (y >= LCD_HEIGHT) || (x + width <= 0) || (y + height <= 0)) return; - + /* clipping */ if (x < 0) { @@ -426,10 +426,10 @@ void xlcd_color_bitmap_part(const unsigned char *src, int src_x, int src_y, fb_data *dst; /* nothing to draw? */ - if ((width <= 0) || (height <= 0) || (x >= LCD_WIDTH) || (y >= LCD_HEIGHT) + if ((width <= 0) || (height <= 0) || (x >= LCD_WIDTH) || (y >= LCD_HEIGHT) || (x + width <= 0) || (y + height <= 0)) return; - + /* clipping */ if (x < 0) { diff --git a/apps/plugins/lib/xlcd_scroll.c b/apps/plugins/lib/xlcd_scroll.c index 89427b6118..5ac4a366e8 100644 --- a/apps/plugins/lib/xlcd_scroll.c +++ b/apps/plugins/lib/xlcd_scroll.c @@ -74,7 +74,7 @@ void xlcd_scroll_right(int count) length = (LCD_WIDTH-count)*LCD_FBHEIGHT; - rb->memmove(lcd_fb + LCD_HEIGHT*count, + rb->memmove(lcd_fb + LCD_HEIGHT*count, lcd_fb, length * sizeof(fb_data)); oldmode = rb->lcd_get_drawmode(); @@ -92,7 +92,7 @@ void xlcd_scroll_up(int count) int width, length, oldmode; - + fb_data *data; if ((unsigned)count >= LCD_HEIGHT) @@ -102,10 +102,10 @@ void xlcd_scroll_up(int count) } length = LCD_HEIGHT - count; - + width = LCD_WIDTH-1; data = lcd_fb; - + do { rb->memmove(data,data + count,length * sizeof(fb_data)); data += LCD_HEIGHT; @@ -126,7 +126,7 @@ void xlcd_scroll_down(int count) int width, length, oldmode; - + fb_data *data; if ((unsigned)count >= LCD_HEIGHT) @@ -139,7 +139,7 @@ void xlcd_scroll_down(int count) width = LCD_WIDTH-1; data = lcd_fb; - + do { rb->memmove(data + count, data, length * sizeof(fb_data)); data += LCD_HEIGHT; @@ -408,7 +408,7 @@ void xlcd_scroll_down(int count) rb->lcd_set_drawmode(oldmode); } -#else /* LCD_PIXELFORMAT == VERTICAL_PACKING, +#else /* LCD_PIXELFORMAT == VERTICAL_PACKING, LCD_PIXELFORMAT == VERTICAL_INTERLEAVED */ /* Scroll up */ @@ -426,7 +426,7 @@ void xlcd_scroll_up(int count) rb->lcd_clear_display(); return; } - + #if (LCD_DEPTH == 1) \ || (LCD_DEPTH == 2) && (LCD_PIXELFORMAT == VERTICAL_INTERLEAVED) blockcount = count >> 3; @@ -554,7 +554,7 @@ void xlcd_scroll_down(int count) rb->lcd_clear_display(); return; } - + #if (LCD_DEPTH == 1) \ || (LCD_DEPTH == 2) && (LCD_PIXELFORMAT == VERTICAL_INTERLEAVED) blockcount = count >> 3; @@ -638,7 +638,7 @@ void xlcd_scroll_down(int count) int x, by; fb_data *addr = lcd_fb + blockcount * LCD_FBWIDTH; unsigned fill, mask; - + fill = patterns[rb->lcd_get_background() & 3] >> (8 - bitcount); mask = (0xFFu >> bitcount) << bitcount; mask |= mask << 8; -- cgit