Commit: 29ab2386c025db7470c21f03f6ab31997eece6b3
Author: Jeroen Bakker
Date:   Tue Jan 14 16:29:45 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rB29ab2386c025db7470c21f03f6ab31997eece6b3

Fix T72200: Split Quad View Region Crash

When splitting a Quad View by dragging a corner an quad area can become
negative size because of a one pixel offset to calculate the start of
the area.

This patch solves this to make sure that there are no negative areas. By
adapting the `ARegion.winrct`.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D6579

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

M       source/blender/editors/screen/area.c

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

diff --git a/source/blender/editors/screen/area.c 
b/source/blender/editors/screen/area.c
index 98bee156090..29626fb6a8f 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -1437,6 +1437,11 @@ static void region_rect_recursive(
         BLI_rcti_init(remainder, 0, 0, 0, 0);
       }
 
+      /* Fix any negative dimensions. This can happen when a quad split 3d 
view gets to small. (see
+       * T72200). BLI_rcti_init() sanitizes, making sure min values are <= max 
values. */
+      BLI_rcti_init(
+          &ar->winrct, ar->winrct.xmin, ar->winrct.xmax, ar->winrct.ymin, 
ar->winrct.ymax);
+
       quad++;
     }
   }
@@ -2897,7 +2902,7 @@ void ED_region_info_draw(ARegion *ar,
                          float fill_color[4],
                          const bool full_redraw)
 {
-  ED_region_info_draw_multiline(ar, (const char *[2]){text, NULL}, fill_color, 
full_redraw);
+  ED_region_info_draw_multiline(ar, (const char * [2]){text, NULL}, 
fill_color, full_redraw);
 }
 
 #define MAX_METADATA_STR 1024

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

Reply via email to