mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
[ui] Use the same key algorithm for Hash_Find
Using label + key_offset in both imui_state_getkey and the call to Hash_Find greatly simplifies the logic of using the correct key. Fixes an ever-growing set of buttons when using separators (hmm, I think this means pruning isn't working correctly).
This commit is contained in:
parent
68e155448d
commit
3aceccf4aa
1 changed files with 1 additions and 3 deletions
|
@ -123,10 +123,8 @@ imui_get_state (imui_ctx_t *ctx, const char *label)
|
|||
key_offset = (key += 3) - label;
|
||||
}
|
||||
label_len = key - label;
|
||||
} else {
|
||||
key = label;
|
||||
}
|
||||
imui_state_t *state = Hash_Find (ctx->tab, key);
|
||||
imui_state_t *state = Hash_Find (ctx->tab, label + key_offset);
|
||||
if (state) {
|
||||
state->frame_count = ctx->frame_count;
|
||||
return state;
|
||||
|
|
Loading…
Reference in a new issue