From a9c6fb0c19f5a3eb884262bd37f7efdac035a20b Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Wed, 9 Jun 2021 15:59:28 +0200 Subject: [PATCH] Improve test in Geometry::covers Horizontally, the old code would count an extra pixel on the right. The vertical test is not changed, and should be eventually audited. Fixes bug #10468. --- src/CoordCache.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/CoordCache.h b/src/CoordCache.h index 38842be83c..d1c0fa3417 100644 --- a/src/CoordCache.h +++ b/src/CoordCache.h @@ -31,10 +31,8 @@ struct Geometry { bool covers(int x, int y) const { - return x >= pos.x_ - && x <= pos.x_ + dim.wid - && y >= pos.y_ - dim.asc - && y <= pos.y_ + dim.des; + return x >= pos.x_ && x < pos.x_ + dim.wid + && y >= pos.y_ - dim.asc && y <= pos.y_ + dim.des; } int squareDistance(int x, int y) const -- 2.39.5