Skip to content

Commit c3f3af5

Browse files
droid42conejoninja
authored andcommitted
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
1 parent 4169408 commit c3f3af5

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

ssd1331/ssd1331.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ func (d *Device) DrawFastHLine(x0, x1, y int16, c color.RGBA) {
220220
if x0 > x1 {
221221
x0, x1 = x1, x0
222222
}
223-
d.FillRectangle(x0, y, x1-x0+1, y, c)
223+
d.FillRectangle(x0, y, x1-x0+1, 1, c)
224224
}
225225

226226
// FillScreen fills the screen with a given color

ssd1351/ssd1351.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ func (d *Device) DrawFastHLine(x0, x1, y int16, c color.RGBA) {
251251
if x0 > x1 {
252252
x0, x1 = x1, x0
253253
}
254-
d.FillRectangle(x0, y, x1-x0+1, y, c)
254+
d.FillRectangle(x0, y, x1-x0+1, 1, c)
255255
}
256256

257257
// FillScreen fills the screen with a given color

st7735/st7735.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ func (d *Device) DrawFastHLine(x0, x1, y int16, c color.RGBA) {
323323
if x0 > x1 {
324324
x0, x1 = x1, x0
325325
}
326-
d.FillRectangle(x0, y, x1-x0+1, y, c)
326+
d.FillRectangle(x0, y, x1-x0+1, 1, c)
327327
}
328328

329329
// FillScreen fills the screen with a given color

st7789/st7789.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ func (d *Device) DrawFastHLine(x0, x1, y int16, c color.RGBA) {
207207
if x0 > x1 {
208208
x0, x1 = x1, x0
209209
}
210-
d.FillRectangle(x0, y, x1-x0+1, y, c)
210+
d.FillRectangle(x0, y, x1-x0+1, 1, c)
211211
}
212212

213213
// FillScreen fills the screen with a given color

0 commit comments

Comments
 (0)