Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-08-17 21:14:06 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-08-17 21:16:07 +0300
commit7f9a1d2f3be4ebbe63ea498d0e24591610c115b3 (patch)
tree4ba772f48710cb437c273e51aebbb6cdd2bf63dc /source/blender/editors/screen/area.c
parent6cad7984c699e7ac1681c1351eb33ce68aac5b4d (diff)
Fix GPU_viewport size asserts in some cases.
Now always tag for redraw when region size is changed instead of relying on a redraw tag having been done elsewhere.
Diffstat (limited to 'source/blender/editors/screen/area.c')
-rw-r--r--source/blender/editors/screen/area.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 3048d7c8156..a031b9f50c7 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -1128,12 +1128,13 @@ bool ED_region_is_overlap(int spacetype, int regiontype)
static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, rcti *overlap_remainder, int quad)
{
rcti *remainder_prev = remainder;
- int prefsizex, prefsizey;
- int alignment;
if (ar == NULL)
return;
+ int prev_winx = ar->winx;
+ int prev_winy = ar->winy;
+
/* no returns in function, winrct gets set in the end again */
BLI_rcti_init(&ar->winrct, 0, 0, 0, 0);
@@ -1142,7 +1143,7 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, rct
if (ar->prev)
remainder = &ar->prev->winrct;
- alignment = ar->alignment & ~RGN_SPLIT_PREV;
+ int alignment = ar->alignment & ~RGN_SPLIT_PREV;
/* set here, assuming userpref switching forces to call this again */
ar->overlap = ED_region_is_overlap(sa->spacetype, ar->regiontype);
@@ -1155,7 +1156,8 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, rct
}
/* prefsize, taking into account DPI */
- prefsizex = UI_DPI_FAC * ((ar->sizex > 1) ? ar->sizex + 0.5f : ar->type->prefsizex);
+ int prefsizex = UI_DPI_FAC * ((ar->sizex > 1) ? ar->sizex + 0.5f : ar->type->prefsizex);
+ int prefsizey;
if (ar->regiontype == RGN_TYPE_HEADER) {
prefsizey = ED_area_headersize();
@@ -1377,6 +1379,11 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, rct
}
region_rect_recursive(sa, ar->next, remainder, overlap_remainder, quad);
+
+ /* Tag for redraw if size changes. */
+ if (ar->winx != prev_winx || ar->winy != prev_winy) {
+ ED_region_tag_redraw(ar);
+ }
}
static void area_calc_totrct(ScrArea *sa, const rcti *window_rect)