From b590a6ef60a8e197d31016754f67728160a397ec Mon Sep 17 00:00:00 2001 From: Michael Hanselmann Date: Sun, 19 Dec 2021 07:52:05 +0100 Subject: [PATCH] waveshare213v2: Use correct row size for clearing Commit ecc1eed contained a typo: the rows of data sent for clearing the display were sized for the height instead of the width. --- waveshare2in13v2/waveshare213v2.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/waveshare2in13v2/waveshare213v2.go b/waveshare2in13v2/waveshare213v2.go index d5fb815..0fcde57 100644 --- a/waveshare2in13v2/waveshare213v2.go +++ b/waveshare2in13v2/waveshare213v2.go @@ -261,7 +261,7 @@ func (d *Dev) Clear(color byte) error { eh.sendCommand(writeRAMBW) - data := bytes.Repeat([]byte{color}, spec.MemRect.Dy()) + data := bytes.Repeat([]byte{color}, spec.MemRect.Dx()) for y := 0; y < spec.MemRect.Max.Y; y++ { eh.sendData(data)