From c3f3af5ffa9a3913b63181a0fc1982da0aeb47a4 Mon Sep 17 00:00:00 2001 From: Alexander Bloss Date: Wed, 6 May 2020 21:23:15 +0200 Subject: [PATCH] Fix DrawFastHLine for ST77xx, SSD1331 and SSD1351 DrawFastHLine uses FillRectangle(x,y,width,height,c), so height must be 1 to draw a horizontal line --- ssd1331/ssd1331.go | 2 +- ssd1351/ssd1351.go | 2 +- st7735/st7735.go | 2 +- st7789/st7789.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ssd1331/ssd1331.go b/ssd1331/ssd1331.go index 1534418..32a11c0 100644 --- a/ssd1331/ssd1331.go +++ b/ssd1331/ssd1331.go @@ -220,7 +220,7 @@ func (d *Device) DrawFastHLine(x0, x1, y int16, c color.RGBA) { if x0 > x1 { x0, x1 = x1, x0 } - d.FillRectangle(x0, y, x1-x0+1, y, c) + d.FillRectangle(x0, y, x1-x0+1, 1, c) } // FillScreen fills the screen with a given color diff --git a/ssd1351/ssd1351.go b/ssd1351/ssd1351.go index 2349613..89eaac9 100644 --- a/ssd1351/ssd1351.go +++ b/ssd1351/ssd1351.go @@ -251,7 +251,7 @@ func (d *Device) DrawFastHLine(x0, x1, y int16, c color.RGBA) { if x0 > x1 { x0, x1 = x1, x0 } - d.FillRectangle(x0, y, x1-x0+1, y, c) + d.FillRectangle(x0, y, x1-x0+1, 1, c) } // FillScreen fills the screen with a given color diff --git a/st7735/st7735.go b/st7735/st7735.go index 5909d20..d6bd463 100644 --- a/st7735/st7735.go +++ b/st7735/st7735.go @@ -323,7 +323,7 @@ func (d *Device) DrawFastHLine(x0, x1, y int16, c color.RGBA) { if x0 > x1 { x0, x1 = x1, x0 } - d.FillRectangle(x0, y, x1-x0+1, y, c) + d.FillRectangle(x0, y, x1-x0+1, 1, c) } // FillScreen fills the screen with a given color diff --git a/st7789/st7789.go b/st7789/st7789.go index ab45336..9aa6426 100644 --- a/st7789/st7789.go +++ b/st7789/st7789.go @@ -207,7 +207,7 @@ func (d *Device) DrawFastHLine(x0, x1, y int16, c color.RGBA) { if x0 > x1 { x0, x1 = x1, x0 } - d.FillRectangle(x0, y, x1-x0+1, y, c) + d.FillRectangle(x0, y, x1-x0+1, 1, c) } // FillScreen fills the screen with a given color