Fix T68672: splash screen does not remain centered when window resizes

Differential Revision: https://developer.blender.org/D5508
This commit is contained in:
Luis de Bethencourt Guimera 2019-08-19 14:51:16 +02:00 committed by Brecht Van Lommel
parent 3f725f10cc
commit aebc596175
Notes: blender-bot 2023-02-14 02:22:07 +01:00
Referenced by issue #68672, Splash screen doesn't reposition vertically
1 changed files with 5 additions and 3 deletions

View File

@ -690,9 +690,11 @@ uiBlock *ui_popup_block_refresh(bContext *C,
/* Avoid menu moving down and losing cursor focus by keeping it at
* the same height. */
if (handle->refresh && handle->prev_block_rect.ymax > block->rect.ymax) {
float offset = handle->prev_block_rect.ymax - block->rect.ymax;
UI_block_translate(block, 0, offset);
block->rect.ymin = handle->prev_block_rect.ymin;
if (block->bounds_type != UI_BLOCK_BOUNDS_POPUP_CENTER) {
float offset = handle->prev_block_rect.ymax - block->rect.ymax;
UI_block_translate(block, 0, offset);
block->rect.ymin = handle->prev_block_rect.ymin;
}
}
handle->prev_block_rect = block->rect;