draw565: Fix line optimization code
sx is measured in pixels (2-bytes) and len(display.linebuffer) gives a value in bytes so the divisor isn't right. Whilst we are here let's make sure we use integer division too. Fixes: #18
This commit is contained in:
parent
4906d46ff4
commit
ac1a799bfa
1 changed files with 2 additions and 2 deletions
|
@ -179,9 +179,9 @@ class Draw565(object):
|
|||
|
||||
display.set_window(x, y, sx, sy)
|
||||
|
||||
if sx <= (len(display.linebuffer) / 2) and not bool(sy & 1):
|
||||
if sx <= (len(display.linebuffer) // 4) and not bool(sy & 1):
|
||||
sx *= 2
|
||||
sy /= 2
|
||||
sy //= 2
|
||||
|
||||
palette = array.array('H', (0, 0xfffe, 0x7bef, 0xffff))
|
||||
next_color = 1
|
||||
|
|
Loading…
Reference in a new issue