mirror of https://github.com/wayvr-org/wayvr.git
wgui: fix stuck mouse release animation state (Closes #296)
This commit is contained in:
parent
502c59424e
commit
5463b6490d
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue