Commit: 3bc15c097c6492559d416a4eafecb7e6936a80b8
Author: Julian Eisel
Date:   Fri May 22 18:33:23 2020 +0200
Branches: master
https://developer.blender.org/rB3bc15c097c6492559d416a4eafecb7e6936a80b8

Fix T76940: Empty HUD (Redo Panel)

If the redo panel was made visible with the same size it had before
(e.g. stored in the file), the runtime region coordinates wouldn't get
set and ended up being all 0. E.g. the simplest way to cause this was
having a collapsed HUD, saving the file, re-opening it with the same
effective DPI and doing an operation so the closed HUD would appear
again.

Now the size is always recalculated if the visibility state of the HUD
changes.

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

M       source/blender/editors/interface/interface_region_hud.c

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

diff --git a/source/blender/editors/interface/interface_region_hud.c 
b/source/blender/editors/interface/interface_region_hud.c
index 34ac58c1dca..1f8af7b9e6e 100644
--- a/source/blender/editors/interface/interface_region_hud.c
+++ b/source/blender/editors/interface/interface_region_hud.c
@@ -177,11 +177,13 @@ static void hud_region_layout(const bContext *C, ARegion 
*region)
     return;
   }
 
+  ScrArea *area = CTX_wm_area(C);
   int size_y = region->sizey;
 
   ED_region_panels_layout(C, region);
 
-  if (region->panels.first && (region->sizey != size_y)) {
+  if (region->panels.first &&
+      ((area->flag & AREA_FLAG_REGION_SIZE_UPDATE) || (region->sizey != 
size_y))) {
     int winx_new = UI_DPI_FAC * (region->sizex + 0.5f);
     int winy_new = UI_DPI_FAC * (region->sizey + 0.5f);
     View2D *v2d = &region->v2d;
@@ -339,6 +341,7 @@ void ED_area_type_hud_ensure(bContext *C, ScrArea *area)
   }
   else {
     if (region->flag & RGN_FLAG_HIDDEN) {
+      /* Also forces recalculating HUD size in hud_region_layout(). */
       area->flag |= AREA_FLAG_REGION_SIZE_UPDATE;
     }
     region->flag &= ~RGN_FLAG_HIDDEN;

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to