From: Jean-Marc Lasgouttes Date: Wed, 9 Jun 2021 13:59:28 +0000 (+0200) Subject: Improve test in Geometry::covers X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=a9c6fb0c;p=features.git 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. --- 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