[Bf-blender-cvs] [2fb94f457e4] topbar: Only remove info editors on top of the window using the full width

Julian Eisel noreply at git.blender.org
Wed Apr 18 22:36:07 CEST 2018


Commit: 2fb94f457e444dae30ed881ec2fb7fae35730f33
Author: Julian Eisel
Date:   Wed Apr 18 22:33:25 2018 +0200
Branches: topbar
https://developer.blender.org/rB2fb94f457e444dae30ed881ec2fb7fae35730f33

Only remove info editors on top of the window using the full width

Removing all info editors could cause issues. Wanted to get proper
layout resolving to work, but wasted more than an entire day on that.
Still planning to look into that again though.

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

M	source/blender/blenloader/intern/versioning_280.c

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

diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index ca8642f6170..5078905bbaa 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -971,19 +971,28 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *main)
 		}
 
 		for (bScreen *screen = main->screen.first; screen; screen = screen->id.next) {
+			int win_width = 0, win_height = 0;
+			/* Calculate window width/height from screen vertices */
+			for (ScrVert *vert = screen->vertbase.first; vert; vert = vert->next) {
+				win_width  = MAX2(win_width, vert->vec.x);
+				win_height = MAX2(win_height, vert->vec.y);
+			}
+
 			for (ScrArea *area = screen->areabase.first, *area_next; area; area = area_next) {
 				area_next = area->next;
 
 				if (area->spacetype == SPACE_INFO) {
-					BKE_screen_area_free(area);
+					if ((area->v2->vec.y == win_height) && (area->v1->vec.x == 0) && (area->v4->vec.x == win_width)) {
+						BKE_screen_area_free(area);
 
-					BLI_remlink(&screen->areabase, area);
+						BLI_remlink(&screen->areabase, area);
 
-					BKE_screen_remove_double_scredges(screen);
-					BKE_screen_remove_unused_scredges(screen);
-					BKE_screen_remove_unused_scrverts(screen);
+						BKE_screen_remove_double_scredges(screen);
+						BKE_screen_remove_unused_scredges(screen);
+						BKE_screen_remove_unused_scrverts(screen);
 
-					MEM_freeN(area);
+						MEM_freeN(area);
+					}
 				}
 				/* AREA_TEMP_INFO is deprecated from now on, it should only be set for info areas
 				 * which are deleted above, so don't need to unset it. Its slot/bit can be reused */



More information about the Bf-blender-cvs mailing list