Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2020-04-26 17:02:18 +0300
committerJulian Eisel <julian@blender.org>2020-04-26 18:39:12 +0300
commita2de3d86de29575698f42a167b8d2c4acf05c38e (patch)
tree9a284e82675857eb91f9a03df26b025287c171f0 /source/blender/editors/interface/interface_anim.c
parent066b0248df1d671609153cac0c5c2a21706363ab (diff)
Fix utterly wrong decorator button logic
This was in fact completely messed up, but it worked by accident for all current cases. That is, we always inserted the decorator buttons immediately after the button they applied to. So the first button comparision in ui_but_anim_decorate_find_attached_button() would succeed, because it just compared a few values that all happened to be NULL and thus the comparison returned true. Further, avoid NULL-pointer dereferences and incorrect printing.
Diffstat (limited to 'source/blender/editors/interface/interface_anim.c')
-rw-r--r--source/blender/editors/interface/interface_anim.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c
index 877216daacc..ed591335660 100644
--- a/source/blender/editors/interface/interface_anim.c
+++ b/source/blender/editors/interface/interface_anim.c
@@ -123,10 +123,11 @@ static uiBut *ui_but_anim_decorate_find_attached_button(uiBut *but_decorate)
BLI_assert(but_decorate->rnasearchpoin.data && but_decorate->rnasearchprop);
LISTBASE_CIRCULAR_BACKWARD_BEGIN (&but_decorate->block->buttons, but_iter, but_decorate->prev) {
- if (but_iter != but_decorate && ui_but_rna_equals_ex(but_decorate,
- &but_iter->rnasearchpoin,
- but_iter->rnasearchprop,
- POINTER_AS_INT(but_iter->custom_data))) {
+ if (but_iter != but_decorate &&
+ ui_but_rna_equals_ex(but_iter,
+ &but_decorate->rnasearchpoin,
+ but_decorate->rnasearchprop,
+ POINTER_AS_INT(but_decorate->custom_data))) {
return but_iter;
}
}
@@ -140,9 +141,10 @@ void ui_but_anim_decorate_update_from_flag(uiBut *but)
const uiBut *but_anim = ui_but_anim_decorate_find_attached_button(but);
if (!but_anim) {
- printf("Could not find button with matching property to decorate (%s.%s)",
- RNA_struct_identifier(but->rnapoin.type),
- RNA_property_identifier(but->rnaprop));
+ printf("Could not find button with matching property to decorate (%s.%s)\n",
+ RNA_struct_identifier(but->rnasearchpoin.type),
+ RNA_property_identifier(but->rnasearchprop));
+ return;
}
int flag = but_anim->flag;