Browse Source

fix hit-by-rect function

master
Alexandros Theodotou 3 years ago
parent
commit
f0c4cf94ca
Signed by: alex
GPG Key ID: 022EAE42313D70F3
  1. 6
      src/ztk_widget.c

6
src/ztk_widget.c

@ -76,12 +76,18 @@ ztk_widget_is_hit_by_rect ( @@ -76,12 +76,18 @@ ztk_widget_is_hit_by_rect (
this->x <= rect->x + rect->width) ||
(this->x + this->width >= rect->x &&
this->x + this->width <=
rect->x + rect->width) ||
(this->x < rect->x &&
this->x + this->width >
rect->x + rect->width))
x_hit = 1;
if ((this->y >= rect->y &&
this->y <= rect->y + rect->height) ||
(this->y + this->height >= rect->y &&
this->y + this->height <=
rect->y + rect->height) ||
(this->y < rect->y &&
this->y + this->height >
rect->y + rect->height))
y_hit = 1;

Loading…
Cancel
Save