Ensure underlines are rendered even for fonts with very poor metrics

Fixes #236
This commit is contained in:
Kovid Goyal
2017-12-19 00:54:04 +05:30
parent eed11361c5
commit 8d94285a5d
2 changed files with 3 additions and 1 deletions

View File

@@ -73,7 +73,7 @@ def resize_fonts(new_sz):
def add_line(buf, cell_width, position, thickness, cell_height):
y = position - thickness // 2
while thickness > 0 and y > -1 and y < cell_height - 1:
while thickness > 0 and y > -1 and y < cell_height:
thickness -= 1
ctypes.memset(ctypes.addressof(buf) + (cell_width * y), 255, cell_width)
y += 1