ili9341: fix Size() for mirrored rotation

This commit is contained in:
Ayke van Laethem
2023-04-12 20:19:07 +02:00
committed by Ron Evans
parent 331a60ce2d
commit 184dff93b1
+4 -2
View File
@@ -138,11 +138,13 @@ func (d *Device) Configure(config Config) {
// Size returns the current size of the display. // Size returns the current size of the display.
func (d *Device) Size() (x, y int16) { func (d *Device) Size() (x, y int16) {
if d.rotation == 1 || d.rotation == 3 { switch d.rotation {
case Rotation90, Rotation270, Rotation90Mirror, Rotation270Mirror:
return d.height, d.width return d.height, d.width
} default: // Rotation0, Rotation180, etc
return d.width, d.height return d.width, d.height
} }
}
// SetPixel modifies the internal buffer. // SetPixel modifies the internal buffer.
func (d *Device) SetPixel(x, y int16, c color.RGBA) { func (d *Device) SetPixel(x, y int16, c color.RGBA) {