wgui: fix stuck mouse release animation state (Closes #296)

This commit is contained in:
Aleksander
2025-12-18 20:54:19 +01:00
parent 502c59424e
commit 5463b6490d

View File

@@ -343,6 +343,15 @@ fn register_event_mouse_release(
state.sticky_down = !state.sticky_down;
}
common.alterables.trigger_haptics();
common.alterables.mark_redraw();
if state.down {
state.down = false;
if state.hovered
&& let Some(on_click) = &state.on_click
{
anim_hover(
rect,
event_data.widget_data,
@@ -353,15 +362,6 @@ fn register_event_mouse_release(
state.sticky_down,
);
common.alterables.trigger_haptics();
common.alterables.mark_redraw();
if state.down {
state.down = false;
if state.hovered
&& let Some(on_click) = &state.on_click
{
on_click(common, ButtonClickEvent {})?;
}
Ok(EventResult::Consumed)