1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-29 20:15:54 +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; const struct aoi *aoi;
if (hovering) { if (hovering) {
if (x >= hovering->x && x < hovering->x + hovering->w && if (in_aoi(hovering, x, y))
y >= hovering->y && y < hovering->y + hovering->h)
return 1; return 1;
hovering->hover(hovering->user, 0); hovering->hover(hovering->user, 0);
hovering = NULL; hovering = NULL;
@ -125,6 +124,7 @@ void aoi_set_related(struct aoi *aoi, const struct aoi *related)
aoi->related = related; aoi->related = related;
} }
void aoi_remove(struct aoi **aois, const struct aoi *aoi) void aoi_remove(struct aoi **aois, const struct aoi *aoi)
{ {
if (hovering == aoi) { if (hovering == aoi) {