From 9816f04f7a31c609cf83e7ea1fbf8d33cdb98c4f Mon Sep 17 00:00:00 2001 From: bptato Date: Sun, 23 Jun 2024 00:40:43 +0200 Subject: term: fix negative line damage bug --- src/local/term.nim | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/local') diff --git a/src/local/term.nim b/src/local/term.nim index 91fe4a88..546b16fa 100644 --- a/src/local/term.nim +++ b/src/local/term.nim @@ -647,12 +647,10 @@ proc clearImage*(term: Terminal; image: CanvasImage; maxh: int) = of imNone: discard of imSixel: # we must clear sixels the same way as we clear text. - var y = max(image.y, 0) let ey = min(image.y + int(image.bmp.height), maxh) - let x = image.x - while y < ey: + let x = max(image.x, 0) + for y in max(image.y, 0) ..< ey: term.lineDamage[y] = min(x, term.lineDamage[y]) - inc y of imKitty: term.imagesToClear.add(image) -- cgit 1.4.1-2-gfad0