SPI based library for the ST7735 LCD controller.

Dependents:   RayCastingEngine RETRO_LCD_PerformanceTest RETRO_loop_test RETRO_RickGame ... more

Files at this revision

API Documentation at this revision

Comitter:
taylorza
Date:
Sun Mar 01 16:30:42 2015 +0000
Parent:
14:c94d0a2c2ba0
Commit message:
Fixed a bug in fill rectangle that excluded the last pixels when the rectangle had a height of 2 pixels.

Changed in this revision

LCD_ST7735.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r c94d0a2c2ba0 -r 516f15979b53 LCD_ST7735.cpp
--- a/LCD_ST7735.cpp	Sun Feb 01 06:49:14 2015 +0000
+++ b/LCD_ST7735.cpp	Sun Mar 01 16:30:42 2015 +0000
@@ -224,7 +224,7 @@
     if (y1 > y2) swap(y1, y2);
     
     clipRect(x1, y1, x2, y2);
-    int c = ((x2-x1) * (y2-y1)) << 1;
+    int c = (((x2 - x1) + 1) * ((y2 - y1) + 1));
     uint8_t colorHigh = fillColor >> 8;
     uint8_t colorLow = fillColor;
     beginBatchCommand(CMD_RAMWR);
@@ -244,7 +244,7 @@
     ++x1; ++y1; --x2; --y2;
     if (x2 >= x1 && y2 >= y1)
     {           
-        int c = ((x2 + 1 - x1) * (y2 + 1 - y1)) << 1;
+        int c = (((x2 - x1) + 1) * ((y2 - y1) + 1));
             
         clipRect(x1, y1, x2, y2);        
         uint8_t colorHigh = fillColor >> 8;