mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-17 21:16:15 +02:00
eeshow/gui/aoi.c (aoi_hover): use in_aoi instead of open-coding the comparison
This commit is contained in:
parent
7eff14b7cd
commit
10c1d0ede0
@ -73,8 +73,7 @@ bool aoi_hover(const struct aoi *aois, int x, int y)
|
||||
const struct aoi *aoi;
|
||||
|
||||
if (hovering) {
|
||||
if (x >= hovering->x && x < hovering->x + hovering->w &&
|
||||
y >= hovering->y && y < hovering->y + hovering->h)
|
||||
if (in_aoi(hovering, x, y))
|
||||
return 1;
|
||||
hovering->hover(hovering->user, 0);
|
||||
hovering = NULL;
|
||||
@ -125,6 +124,7 @@ void aoi_set_related(struct aoi *aoi, const struct aoi *related)
|
||||
aoi->related = related;
|
||||
}
|
||||
|
||||
|
||||
void aoi_remove(struct aoi **aois, const struct aoi *aoi)
|
||||
{
|
||||
if (hovering == aoi) {
|
||||
|
Loading…
Reference in New Issue
Block a user