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.
This commit is contained in:
Jean-Marc Lasgouttes 2021-06-09 15:59:28 +02:00
parent 22cb573cac
commit a9c6fb0c19

View File

@ -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