Fix number sliders not working

Own mistake in d204830107.

For some buttons the type is changed after construction, which means the button
has to be reconstructed. For example number buttons can be turned into number
slider buttons this way. New code was unintentionally overriding the button
type after reconstruction with the old type again.
This commit is contained in:
Julian Eisel 2023-02-03 18:42:14 +01:00
parent 23506622a5
commit 6590a288b0
1 changed files with 2 additions and 0 deletions

View File

@ -4048,6 +4048,8 @@ uiBut *ui_but_change_type(uiBut *but, eButType new_type)
/* Copy construct button with the new type. */
but = ui_but_new(new_type);
*but = *old_but_ptr;
/* We didn't mean to override this :) */
but->type = new_type;
if (has_str_ptr_to_self) {
but->str = but->strdata;
}