Commit: 5d6d5b7272596ef58dbaa06327f0fe1720d66158
Author: Sergey Sharybin
Date:   Wed Jan 27 11:04:21 2016 +0100
Branches: master
https://developer.blender.org/rB5d6d5b7272596ef58dbaa06327f0fe1720d66158

Fix T46624: Preview is not always correctly updated

It is possible that preview was not updated to correspond a
new context when width of preview is the same for two contexts.

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

M       source/blender/makesrna/intern/rna_space.c

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

diff --git a/source/blender/makesrna/intern/rna_space.c 
b/source/blender/makesrna/intern/rna_space.c
index df5bbe8..52b84fa 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -1102,6 +1102,14 @@ static EnumPropertyItem 
*rna_SpaceProperties_context_itemf(bContext *UNUSED(C),
        return item;
 }
 
+static void rna_SpaceProperties_context_update(Main *UNUSED(bmain), Scene 
*UNUSED(scene), PointerRNA *ptr)
+{
+       SpaceButs *sbuts = (SpaceButs *)(ptr->data);
+       if (ELEM(sbuts->mainb, BCONTEXT_WORLD, BCONTEXT_MATERIAL, 
BCONTEXT_TEXTURE)) {
+               sbuts->preview = 1;
+       }
+}
+
 static void rna_SpaceProperties_align_set(PointerRNA *ptr, int value)
 {
        SpaceButs *sbuts = (SpaceButs *)(ptr->data);
@@ -2845,7 +2853,7 @@ static void rna_def_space_buttons(BlenderRNA *brna)
        RNA_def_property_enum_items(prop, buttons_context_items);
        RNA_def_property_enum_funcs(prop, NULL, 
"rna_SpaceProperties_context_set", "rna_SpaceProperties_context_itemf");
        RNA_def_property_ui_text(prop, "Context", "Type of active data to 
display and edit");
-       RNA_def_property_update(prop, NC_SPACE | ND_SPACE_PROPERTIES, NULL);
+       RNA_def_property_update(prop, NC_SPACE | ND_SPACE_PROPERTIES, 
"rna_SpaceProperties_context_update");
        
        prop = RNA_def_property(srna, "align", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_sdna(prop, NULL, "align");

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to