Fix T62526: Can't scroll redo panel

This commit is contained in:
Campbell Barton 2019-03-14 09:58:20 +11:00
parent daaabd076d
commit 3a58e97aed
Notes: blender-bot 2023-06-07 10:31:13 +02:00
Referenced by issue #62526, Cannot scroll down in tool options.
3 changed files with 23 additions and 3 deletions

View File

@ -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;

View File

@ -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,

View File

@ -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 */