mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
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:
parent
22cb573cac
commit
a9c6fb0c19
@ -31,10 +31,8 @@ struct Geometry {
|
|||||||
|
|
||||||
bool covers(int x, int y) const
|
bool covers(int x, int y) const
|
||||||
{
|
{
|
||||||
return x >= pos.x_
|
return x >= pos.x_ && x < pos.x_ + dim.wid
|
||||||
&& x <= pos.x_ + dim.wid
|
&& y >= pos.y_ - dim.asc && y <= pos.y_ + dim.des;
|
||||||
&& y >= pos.y_ - dim.asc
|
|
||||||
&& y <= pos.y_ + dim.des;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int squareDistance(int x, int y) const
|
int squareDistance(int x, int y) const
|
||||||
|
Loading…
Reference in New Issue
Block a user