Added triangles + reset
[hackover2013-badge-firmware.git] / drivers / lcd / tft / hw / ILI9325.c
index d7fc0e1..8b0e64a 100644 (file)
@@ -476,17 +476,21 @@ void lcdDrawHLine(uint16_t x0, uint16_t x1, uint16_t y, uint16_t color)
 /**************************************************************************/
 void lcdDrawVLine(uint16_t x, uint16_t y0, uint16_t y1, uint16_t color)
 {
-  // Allows for slightly better performance than setting individual pixels
-  lcdOrientation_t orientation = lcdOrientation;
-
-  // Switch orientation
-  lcdSetOrientation(orientation == LCD_ORIENTATION_PORTRAIT ? LCD_ORIENTATION_LANDSCAPE : LCD_ORIENTATION_PORTRAIT);
+  lcdOrientation_t oldOrientation = lcdOrientation;
 
-  // Draw horizontal line like usual
-  lcdDrawHLine(y0, y1, lcdGetHeight() - (x + 1), color);
+  if (oldOrientation == LCD_ORIENTATION_PORTRAIT)
+  {
+    lcdSetOrientation(LCD_ORIENTATION_LANDSCAPE);
+    lcdDrawHLine(y0, y1, lcdGetHeight() - (x + 1), color);
+  }
+  else
+  {
+    lcdSetOrientation(LCD_ORIENTATION_PORTRAIT);
+    lcdDrawHLine(lcdGetWidth() - (y0 + 1), lcdGetWidth() - (y1 + 1), x, color);
+  }
 
   // Switch orientation back
-  lcdSetOrientation(orientation);
+  lcdSetOrientation(oldOrientation);
 }
 
 /**************************************************************************/
This page took 0.025463 seconds and 4 git commands to generate.