summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2025-09-25 13:30:01 -0400
committerJonathan Bradley <jcb@pikum.xyz>2025-09-25 13:30:01 -0400
commiteb48a3affea5514811eed488f8c87aba066b062c (patch)
treefd4d9c096d201a374dfc77e9fe11ab97c79d4ed3
parenta503774a2413b6ab206eaeefd667287f0f80e2be (diff)
pke: static ui mouse hover ignore padding
-rw-r--r--src/static-ui.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/static-ui.cpp b/src/static-ui.cpp
index 752608e..f3d0810 100644
--- a/src/static-ui.cpp
+++ b/src/static-ui.cpp
@@ -195,10 +195,10 @@ void pke_ui_update_state(pke_ui_box &box) {
}
pke_input_query_mouse_pos(mouse_x, mouse_y);
- if (mouse_x >= box.internal.px_corner.x + box.internal.px_padding_l
- && mouse_y >= box.internal.px_corner.y + box.internal.px_padding_t
- && mouse_x <= box.internal.px_corner.x + box.internal.px_size.x - box.internal.px_padding_r
- && mouse_y <= box.internal.px_corner.y + box.internal.px_size.y - box.internal.px_padding_b) {
+ if (mouse_x >= box.internal.px_corner.x
+ && mouse_y >= box.internal.px_corner.y
+ && mouse_x <= box.internal.px_corner.x + box.internal.px_size.x
+ && mouse_y <= box.internal.px_corner.y + box.internal.px_size.y) {
box.state_flags |= PKE_UI_BOX_STATE_FLAG_MOUSE_HOVER;
if (!PK_HAS_FLAG(old_state, PKE_UI_BOX_STATE_FLAG_MOUSE_HOVER)) {
box.state_flags |= PKE_UI_BOX_STATE_FLAG_MOUSE_ENTERED;