draw565: Fix an out-by-one error in _bounding_box
Currently we add an extra blank pixel to the end of the string but this is not required. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
This commit is contained in:
parent
463ba50d2b
commit
a124734ff2
1 changed files with 4 additions and 3 deletions
|
@ -74,10 +74,11 @@ def _bounding_box(s, font):
|
||||||
if not s:
|
if not s:
|
||||||
return (0, font.height())
|
return (0, font.height())
|
||||||
|
|
||||||
w = 0
|
get_ch = font.get_ch
|
||||||
|
w = len(s) - 1
|
||||||
for ch in s:
|
for ch in s:
|
||||||
(_, h, wc) = font.get_ch(ch)
|
(_, h, wc) = get_ch(ch)
|
||||||
w += wc + 1
|
w += wc
|
||||||
|
|
||||||
return (w, h)
|
return (w, h)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue