Mercurial > molko
comparison src/core/button.c @ 106:ed1a6bb02a78
inventory_dialog: use a small circle as test
author | David Demelier <markand@malikania.fr> |
---|---|
date | Wed, 01 Apr 2020 12:10:00 +0200 |
parents | 4ac71ac10c9f |
children | 3bd0d3a39e30 |
comparison
equal
deleted
inserted
replaced
105:f6b5e2fbbc81 | 106:ed1a6bb02a78 |
---|---|
18 | 18 |
19 #include <assert.h> | 19 #include <assert.h> |
20 | 20 |
21 #include "button.h" | 21 #include "button.h" |
22 #include "event.h" | 22 #include "event.h" |
23 #include "math.h" | 23 #include "maths.h" |
24 #include "theme.h" | 24 #include "theme.h" |
25 | 25 |
26 static bool | 26 static bool |
27 is_boxed(const struct button *button, const struct event_click *click) | 27 is_boxed(const struct button *button, const struct event_click *click) |
28 { | 28 { |
29 assert(button); | 29 assert(button); |
30 assert(click); | 30 assert(click); |
31 assert(click->type == EVENT_CLICKDOWN || click->type == EVENT_CLICKUP); | 31 assert(click->type == EVENT_CLICKDOWN || click->type == EVENT_CLICKUP); |
32 | 32 |
33 return math_is_boxed(button->x, button->y, button->w, button->h, | 33 return maths_is_boxed(button->x, button->y, button->w, button->h, |
34 click->x, click->y); | 34 click->x, click->y); |
35 } | 35 } |
36 | 36 |
37 void | 37 void |
38 button_handle(struct button *button, const union event *ev) | 38 button_handle(struct button *button, const union event *ev) |