1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-12-23 08:15:31 +02:00

eeshow/gui/aoi.c (aoi_hover): use in_aoi instead of open-coding the comparison

This commit is contained in:
Werner Almesberger 2016-08-19 05:30:58 -03:00
parent 7eff14b7cd
commit 10c1d0ede0

View File

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