wgui: fix stuck mouse release animation state (Closes #296)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user