mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-09-11 09:09:28 +00:00
examples: add 2.13in e-Paper V1 demo for RP2040-PiZero
Exercise all four SetRotation modes in the demo. Fix epd2in13.Size(), which reported the padded logical buffer width instead of the true panel width at rotation 90 and 270. This clipped the last few rows on those rotations because the driver bounds check used the true width while Size() reported the padded width. Scale the dither ramp and solid block to the panel height instead of fixed pixel offsets, so they fit inside the shorter 122 pixel dimension at rotation 90 and 270.
This commit is contained in:
committed by
Daniel Esteban
parent
4f6f6bc66f
commit
3b4cdece03
@@ -318,9 +318,9 @@ func (d *Device) ClearBuffer() {
|
||||
// Size returns the current size of the display.
|
||||
func (d *Device) Size() (w, h int16) {
|
||||
if d.rotation == drivers.Rotation90 || d.rotation == drivers.Rotation270 {
|
||||
return d.height, d.logicalWidth
|
||||
return d.height, d.width
|
||||
}
|
||||
return d.logicalWidth, d.height
|
||||
return d.width, d.height
|
||||
}
|
||||
|
||||
// Rotation returns the current rotation of the device.
|
||||
|
||||
Reference in New Issue
Block a user