[Bf-blender-cvs] [214cc3c2451] master: Fix failing assert because of invalid region coordinates

Julian Eisel noreply at git.blender.org
Mon Mar 9 18:06:38 CET 2020


Commit: 214cc3c245194a312b1f5e23d6b779b40ebe3569
Author: Julian Eisel
Date:   Mon Mar 9 17:56:43 2020 +0100
Branches: master
https://developer.blender.org/rB214cc3c245194a312b1f5e23d6b779b40ebe3569

Fix failing assert because of invalid region coordinates

Steps to reproduce were:
* Disable tool settings region in 3D View (View > Tool Settings)
* Split the 3D View and drag all the way down

The removed code doesn't seem to be needed anymore. Tested this on hiDPI
too, seems fine.

These kind of fixes are always tricky, so I wouldn't be surprised if
there are any issues caused by this.

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

M	source/blender/editors/screen/area.c
M	source/blender/windowmanager/intern/wm_window.c

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

diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 444413a757f..cff7052ca58 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -1382,6 +1382,7 @@ static void region_rect_recursive(
         region->winrct.ymax = region->winrct.ymin + prefsizey - 1;
         winrct->ymin = region->winrct.ymax + 1;
       }
+      BLI_rcti_sanitize(winrct);
     }
   }
   else if (ELEM(alignment, RGN_ALIGN_LEFT, RGN_ALIGN_RIGHT)) {
@@ -1407,6 +1408,7 @@ static void region_rect_recursive(
         region->winrct.xmax = region->winrct.xmin + prefsizex - 1;
         winrct->xmin = region->winrct.xmax + 1;
       }
+      BLI_rcti_sanitize(winrct);
     }
   }
   else if (alignment == RGN_ALIGN_VSPLIT || alignment == RGN_ALIGN_HSPLIT) {
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index 57612964295..fe6272686bc 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -2167,21 +2167,9 @@ void WM_window_screen_rect_calc(const wmWindow *win, rcti *r_rect)
 
     switch (global_area->global->align) {
       case GLOBAL_AREA_ALIGN_TOP:
-        if ((screen_rect.ymax - height) > window_rect.ymin) {
-          height += U.pixelsize;
-        }
-        if (screen_rect.ymax < (window_rect.ymax - 1)) {
-          height += U.pixelsize;
-        }
         screen_rect.ymax -= height;
         break;
       case GLOBAL_AREA_ALIGN_BOTTOM:
-        if (screen_rect.ymin > window_rect.ymin) {
-          height += U.pixelsize;
-        }
-        if ((screen_rect.ymin + height) < (window_rect.ymax - 1)) {
-          height += U.pixelsize;
-        }
         screen_rect.ymin += height;
         break;
       default:



More information about the Bf-blender-cvs mailing list