From 8f50bf5ea0c22a668d1e17aad70ba5080032ea16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Knecht?= Date: Fri, 14 Dec 2012 15:22:16 +0100 Subject: [PATCH] Fix fence post error in page-widget's redraw_rect() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A rectangle whose horizontal coordinates are x1 on the left and x2 on the right is (x2 + 1) - x1 pixels wide, not x2 - x1. This error caused the search result highlighting to leave a one-pixel-wide border behind, on the right and bottom side of the result. See issue 242 . Reported-by: Abdó Roig Signed-off-by: Sebastian Ramacher --- page-widget.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/page-widget.c b/page-widget.c index 789b0f9..ac7e93d 100644 --- a/page-widget.c +++ b/page-widget.c @@ -506,8 +506,8 @@ redraw_rect(ZathuraPage* widget, zathura_rectangle_t* rectangle) GdkRectangle grect; grect.x = rectangle->x1; grect.y = rectangle->y1; - grect.width = rectangle->x2 - rectangle->x1; - grect.height = rectangle->y2 - rectangle->y1; + grect.width = (rectangle->x2 + 1) - rectangle->x1; + grect.height = (rectangle->y2 + 1) - rectangle->y1; #if (GTK_MAJOR_VERSION == 3) gtk_widget_queue_draw_area(GTK_WIDGET(widget), grect.x, grect.y, grect.width, grect.height); #else