summaryrefslogtreecommitdiff
path: root/firmware/target/arm/as3525/lcd-ssd1303.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2012-05-19 17:21:54 -0400
committerMichael Sevakis <jethead71@rockbox.org>2012-05-19 17:21:54 -0400
commitc2e9c93563298141058ed89b8c2f14138c3a2b88 (patch)
tree4fe8be4a7a6cf3c6780489a18bcd50277b986306 /firmware/target/arm/as3525/lcd-ssd1303.c
parentb1dcd298c7a5622944e628bf0da4bd04f5f59675 (diff)
downloadrockbox-c2e9c93563298141058ed89b8c2f14138c3a2b88.tar.gz
rockbox-c2e9c93563298141058ed89b8c2f14138c3a2b88.zip
lcd-ssd1303: Fix big oops putting height where there should've been width.
Rid code of dar commasar and substitute huggy braces while we're at it. :P Change-Id: If91974b93660bb0de32a0c92629eb83cea99d266
Diffstat (limited to 'firmware/target/arm/as3525/lcd-ssd1303.c')
-rw-r--r--firmware/target/arm/as3525/lcd-ssd1303.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/firmware/target/arm/as3525/lcd-ssd1303.c b/firmware/target/arm/as3525/lcd-ssd1303.c
index a36cf87d95..a00398a998 100644
--- a/firmware/target/arm/as3525/lcd-ssd1303.c
+++ b/firmware/target/arm/as3525/lcd-ssd1303.c
@@ -288,15 +288,26 @@ void lcd_update_rect(int x, int y, int width, int height)
288 288
289 /* The Y coordinates have to work on even 8 pixel rows */ 289 /* The Y coordinates have to work on even 8 pixel rows */
290 if (x < 0) 290 if (x < 0)
291 height += x, x = 0; 291 {
292 width += x;
293 x = 0;
294 }
295
292 if (x + width > LCD_WIDTH) 296 if (x + width > LCD_WIDTH)
293 width = LCD_WIDTH - x; 297 width = LCD_WIDTH - x;
298
294 if (width <= 0) 299 if (width <= 0)
295 return; /* nothing left to do, 0 is harmful to lcd_write_data() */ 300 return; /* nothing left to do, 0 is harmful to lcd_write_data() */
301
296 if (y < 0) 302 if (y < 0)
297 height += y, y = 0; 303 {
304 height += y;
305 y = 0;
306 }
307
298 if (y + height > LCD_HEIGHT) 308 if (y + height > LCD_HEIGHT)
299 height = LCD_HEIGHT - y; 309 height = LCD_HEIGHT - y;
310
300 if (height <= 0) 311 if (height <= 0)
301 return; /* nothing left to do */ 312 return; /* nothing left to do */
302 313