mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-25 01:38:02 +02:00
Ensure bounds in add_dline()
This commit is contained in:
@@ -93,6 +93,8 @@ def add_dline(buf, cell_width, position, thickness, cell_height):
|
|||||||
top -= deficit - 1
|
top -= deficit - 1
|
||||||
else:
|
else:
|
||||||
top -= deficit
|
top -= deficit
|
||||||
|
top = max(0, min(top, cell_height - 1))
|
||||||
|
bottom = max(0, min(bottom, cell_height - 1))
|
||||||
for y in {top, bottom}:
|
for y in {top, bottom}:
|
||||||
ctypes.memset(ctypes.addressof(buf) + (cell_width * y), 255, cell_width)
|
ctypes.memset(ctypes.addressof(buf) + (cell_width * y), 255, cell_width)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user