1
0
Fork 0

draw565: fix width handling for vertical and horizontal lines

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
This commit is contained in:
Daniel Thompson 2020-12-27 18:18:14 +00:00
parent 6d3f2126bf
commit b7c622c03d

View file

@ -395,8 +395,8 @@ class Draw565(object):
if x1 < x0 or y1 < y0: if x1 < x0 or y1 < y0:
x0, x1 = x1, x0 x0, x1 = x1, x0
y0, y1 = y1, y0 y0, y1 = y1, y0
w = width if dx == 0 else dx w = width if dx == 0 else (dx + width - 1)
h = width if dy == 0 else -dy h = width if dy == 0 else (-dy + width - 1)
self.fill(color, x0, y0, w, h) self.fill(color, x0, y0, w, h)
return return
while True: while True: