diff options
author | Julian Eisel <julian@blender.org> | 2020-05-22 19:33:23 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2020-05-22 19:40:10 +0300 |
commit | 3bc15c097c6492559d416a4eafecb7e6936a80b8 (patch) | |
tree | 13d8b6709eac7f5d00940b01c9444e180bebe409 /source/blender/editors/interface | |
parent | 43d33b3626f46c9a1bf40ae1671d098e77e0d4f3 (diff) |
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.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_region_hud.c | 5 |
1 files changed, 4 insertions, 1 deletions
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 = ®ion->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; |