Commit 04099df
committed
MENU/XMB: fix stacking tweens on categories_x_pos during rapid horizontal input
gfx_animation_push appends rather than replaces, and the two horizontal
tab-scroll animation sites (xmb_list_switch and the drag-release handler
in xmb_pointer_up) were both pushing with tag = -1 — the animation
system's "no tag" sentinel, which gfx_animation_kill_by_tag explicitly
refuses to act on.
The consequence is that rapid left/right input, or a drag-release
landing on an in-flight tab-switch tween, stacks two or more tweens
on xmb->categories_x_pos. Each frame gfx_animation_update iterates
the tween list and every matching tween writes the subject in order,
so last-write-wins by append order. The visible settled position is
non-deterministic during overlap, and the float never reliably
matches its intended target until all stacked tweens have finished
on their own timelines.
Switch both sites to a unique tag, (uintptr_t)&xmb->categories_x_pos —
the same pattern xmb_context_reset_horizontal_list already uses for
xmb->x — and kill any in-flight tween on that tag before pushing the
new one. Also kill on the non-animated branches: direct assignments
would otherwise be clobbered on the next tick if a tween were still
running (e.g. menu_horizontal_animation toggled off mid-animation,
or xmb_context_reset_horizontal_list invoked during a transition).
xmb_init is not touched because the handle is being allocated there
and no tweens can exist.
Incidentally resolves the TODO/FIXME comment about the sign-conversion
warning on "anim_entry.tag = -1".
No user-visible behaviour change during normal single-step navigation,
where only one tween is ever active. Fast input and drag-interrupt
cases now resolve cleanly to the last-pressed target.1 parent d4e75bb commit 04099df
1 file changed
Lines changed: 39 additions & 3 deletions
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2805 | 2805 | | |
2806 | 2806 | | |
2807 | 2807 | | |
| 2808 | + | |
| 2809 | + | |
2808 | 2810 | | |
2809 | 2811 | | |
2810 | 2812 | | |
2811 | 2813 | | |
2812 | | - | |
2813 | | - | |
| 2814 | + | |
2814 | 2815 | | |
2815 | 2816 | | |
| 2817 | + | |
| 2818 | + | |
| 2819 | + | |
| 2820 | + | |
| 2821 | + | |
| 2822 | + | |
| 2823 | + | |
| 2824 | + | |
| 2825 | + | |
| 2826 | + | |
| 2827 | + | |
2816 | 2828 | | |
2817 | 2829 | | |
2818 | 2830 | | |
2819 | 2831 | | |
| 2832 | + | |
| 2833 | + | |
| 2834 | + | |
| 2835 | + | |
| 2836 | + | |
| 2837 | + | |
| 2838 | + | |
2820 | 2839 | | |
| 2840 | + | |
2821 | 2841 | | |
2822 | 2842 | | |
2823 | 2843 | | |
| |||
3029 | 3049 | | |
3030 | 3050 | | |
3031 | 3051 | | |
| 3052 | + | |
3032 | 3053 | | |
3033 | 3054 | | |
| 3055 | + | |
| 3056 | + | |
| 3057 | + | |
| 3058 | + | |
3034 | 3059 | | |
3035 | 3060 | | |
3036 | 3061 | | |
| |||
10040 | 10065 | | |
10041 | 10066 | | |
10042 | 10067 | | |
| 10068 | + | |
| 10069 | + | |
10043 | 10070 | | |
10044 | 10071 | | |
10045 | 10072 | | |
10046 | 10073 | | |
10047 | | - | |
| 10074 | + | |
10048 | 10075 | | |
10049 | 10076 | | |
| 10077 | + | |
| 10078 | + | |
| 10079 | + | |
| 10080 | + | |
| 10081 | + | |
10050 | 10082 | | |
10051 | 10083 | | |
10052 | 10084 | | |
10053 | 10085 | | |
| 10086 | + | |
| 10087 | + | |
| 10088 | + | |
10054 | 10089 | | |
| 10090 | + | |
10055 | 10091 | | |
10056 | 10092 | | |
10057 | 10093 | | |
| |||
0 commit comments