diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-03-14 01:58:20 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-03-14 01:59:03 +0300 |
commit | 3a58e97aed963b43984250e6ce40cd863b71e4b6 (patch) | |
tree | 3ff086b75e7f9b82a556e455b728f0e56191510b /source | |
parent | daaabd076d125d7b61b00ff49fbca04bbf9c3129 (diff) |
Fix T62526: Can't scroll redo panel
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface_region_hud.c | 14 | ||||
-rw-r--r-- | source/blender/editors/screen/area.c | 9 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_screen_types.h | 3 |
3 files changed, 23 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_region_hud.c b/source/blender/editors/interface/interface_region_hud.c index e874609f61e..f6a5c9611af 100644 --- a/source/blender/editors/interface/interface_region_hud.c +++ b/source/blender/editors/interface/interface_region_hud.c @@ -178,9 +178,19 @@ static void hud_region_layout(const bContext *C, ARegion *ar) ED_region_panels_layout(C, ar); if (ar->panels.first && (ar->sizey != size_y)) { + int winx_new = UI_DPI_FAC * (ar->sizex + 0.5f); + int winy_new = UI_DPI_FAC * (ar->sizey + 0.5f); View2D *v2d = &ar->v2d; - ar->winx = ar->sizex * UI_DPI_FAC; - ar->winy = ar->sizey * UI_DPI_FAC; + + if (ar->flag & RGN_FLAG_SIZE_CLAMP_X) { + CLAMP_MAX(winx_new, ar->winx); + } + if (ar->flag & RGN_FLAG_SIZE_CLAMP_Y) { + CLAMP_MAX(winy_new, ar->winy); + } + + ar->winx = winx_new; + ar->winy = winy_new; ar->winrct.xmax = (ar->winrct.xmin + ar->winx) - 1; ar->winrct.ymax = (ar->winrct.ymin + ar->winy) - 1; diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index ad9bcaf59cc..a430ccdc95e 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1145,7 +1145,7 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, rct ar->overlap = ED_region_is_overlap(sa->spacetype, ar->regiontype); /* clear state flags first */ - ar->flag &= ~RGN_FLAG_TOO_SMALL; + ar->flag &= ~(RGN_FLAG_TOO_SMALL | RGN_FLAG_SIZE_CLAMP_X | RGN_FLAG_SIZE_CLAMP_Y); /* user errors */ if ((ar->next == NULL) && !ELEM(alignment, RGN_ALIGN_QSPLIT, RGN_ALIGN_FLOAT)) { alignment = RGN_ALIGN_NONE; @@ -1196,6 +1196,13 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, rct BLI_rcti_isect(&ar->winrct, &overlap_remainder_margin, &ar->winrct); + if (BLI_rcti_size_x(&ar->winrct) != prefsizex - 1) { + ar->flag |= RGN_FLAG_SIZE_CLAMP_X; + } + if (BLI_rcti_size_y(&ar->winrct) != prefsizey - 1) { + ar->flag |= RGN_FLAG_SIZE_CLAMP_Y; + } + /* We need to use a test that wont have been previously clamped. */ rcti winrct_test = { .xmin = ar->winrct.xmin, diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h index 19e1f824ced..c62aed7402b 100644 --- a/source/blender/makesdna/DNA_screen_types.h +++ b/source/blender/makesdna/DNA_screen_types.h @@ -625,6 +625,9 @@ enum { RGN_FLAG_TEMP_REGIONDATA = (1 << 3), /* The region must either use its prefsizex/y or be hidden. */ RGN_FLAG_PREFSIZE_OR_HIDDEN = (1 << 4), + /** Size has been clamped (floating regions only). */ + RGN_FLAG_SIZE_CLAMP_X = (1 << 5), + RGN_FLAG_SIZE_CLAMP_Y = (1 << 6), }; /** #ARegion.do_draw */ |