[Bf-blender-cvs] [6590a288b05] master: Fix number sliders not working

Julian Eisel noreply at git.blender.org
Fri Feb 3 18:46:28 CET 2023


Commit: 6590a288b0538c58fac68fb55ffd0819a8d6d5b8
Author: Julian Eisel
Date:   Fri Feb 3 18:42:14 2023 +0100
Branches: master
https://developer.blender.org/rB6590a288b0538c58fac68fb55ffd0819a8d6d5b8

Fix number sliders not working

Own mistake in d204830107ef.

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.

===================================================================

M	source/blender/editors/interface/interface.cc

===================================================================

diff --git a/source/blender/editors/interface/interface.cc b/source/blender/editors/interface/interface.cc
index bf1f276d702..3e355af823a 100644
--- a/source/blender/editors/interface/interface.cc
+++ b/source/blender/editors/interface/interface.cc
@@ -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;
   }



More information about the Bf-blender-cvs mailing list