Better accounting for finger radius in UI.Button
@@ -732,7 +732,7 @@ void ui_button_behavior(vec3 window_relative_pos, vec2 size, uint64_t id, float
// completely through the button. Width and height is added to this
// volume to account for vertical or horizontal movement during a press,
// such as the downward motion often accompanying a 'poke' motion.
- float activation_plane = skui_settings.depth + skui_finger_radius;
+ float activation_plane = skui_settings.depth + skui_finger_radius*2;
vec3 activation_start = window_relative_pos + vec3{ 0, 0, -activation_plane };
vec3 activation_size = vec3{ size.x, size.y, 0.0001f };
@@ -747,7 +747,7 @@ void ui_button_behavior(vec3 window_relative_pos, vec2 size, uint64_t id, float
// If a hand is interacting, adjust the button surface accordingly
finger_offset = skui_settings.depth;
if (focus_state & button_state_active) {
- finger_offset = -skui_hand[hand].finger.z - window_relative_pos.z;
+ finger_offset = -(skui_hand[hand].finger.z+skui_finger_radius) - window_relative_pos.z;
bool pressed = finger_offset < skui_settings.depth / 2;
button_state = ui_active_set(hand, id, pressed);
finger_offset = fminf(fmaxf(2*mm2m, finger_offset), skui_settings.depth);
