SPI based library for the ST7735 LCD controller.

Dependents:   RayCastingEngine RETRO_LCD_PerformanceTest RETRO_loop_test RETRO_RickGame ... more

Revision:
15:516f15979b53
Parent:
14:c94d0a2c2ba0
--- 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;