- // 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);
+ }