diff options
author | bptato <nincsnevem662@gmail.com> | 2024-06-23 00:40:43 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-06-23 00:40:43 +0200 |
commit | 9816f04f7a31c609cf83e7ea1fbf8d33cdb98c4f (patch) | |
tree | 7651a3d594655bf5a952cb8a658be979198d5de3 /src | |
parent | 3aaddac030f612fd5221d1d0b6ea501a135459ac (diff) | |
download | chawan-9816f04f7a31c609cf83e7ea1fbf8d33cdb98c4f.tar.gz |
term: fix negative line damage bug
Diffstat (limited to 'src')
-rw-r--r-- | src/local/term.nim | 6 |
1 files changed, 2 insertions, 4 deletions
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) |