From cf8ccabad9f4c30393f1f007589db5a86fd1b6cf Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 13 May 2022 09:51:25 +0530 Subject: [PATCH] Fix deleting images by row not calculating image bounds correctly Fixes #5081 --- docs/changelog.rst | 2 ++ kitty/graphics.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 987fa0fa9..0546e4dd2 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -59,6 +59,8 @@ Detailed list of changes - Fix reloading of config not working when :file:`kitty.conf` does not exist when kitty is launched (:iss:`5071`) +- Fix deleting images by row not calculating image bounds correctly (:iss:`5081`) + 0.25.0 [2022-04-11] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kitty/graphics.c b/kitty/graphics.c index b8208d11e..3b151dd35 100644 --- a/kitty/graphics.c +++ b/kitty/graphics.c @@ -1505,7 +1505,7 @@ x_filter_func(const ImageRef *ref, Image UNUSED *img, const void *data, CellPixe static bool y_filter_func(const ImageRef *ref, Image UNUSED *img, const void *data, CellPixelSize cell UNUSED) { const GraphicsCommand *g = data; - return ref->start_row <= (int32_t)g->y_offset - 1 && ((int32_t)(g->y_offset - 1 < ref->start_row + ref->effective_num_rows)); + return ref->start_row <= (int32_t)g->y_offset - 1 && ((int32_t)g->y_offset - 1) < ((int32_t)(ref->start_row + ref->effective_num_rows)); } static bool