Fix failing "Edit Source" (asserts) while number slider was visible
E.g. steps to reproduce:
* Enter Vertex Paint mode
* In the tool settings, right-click > "Edit Source"
When creating a number slider via `layout.prop(..., slider=True)`, the UI code
would reallocate the number button to be a number-slider button. That's because
we now actually have different button data-structures for these (see
e6f0b60c2e). The edit source code stored data based on the button pointers,
which didn't get updated after changing the type. The fix just adds this
updating.
			
			
This commit is contained in:
		@@ -3948,6 +3948,9 @@ uiBut *ui_but_change_type(uiBut *but, eButType new_type)
 | 
			
		||||
      UNUSED_VARS_NDEBUG(found_layout);
 | 
			
		||||
      ui_button_group_replace_but_ptr(uiLayoutGetBlock(but->layout), old_but_ptr, but);
 | 
			
		||||
    }
 | 
			
		||||
    if (UI_editsource_enable_check()) {
 | 
			
		||||
      UI_editsource_but_replace(old_but_ptr, but);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return but;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user