Page MenuHome

UI: Re-center the splash screen vertically when window resizes

Authored by Luis de Bethencourt Guimera (luisbg) on Aug 17 2019, 1:54 AM.

Diff Detail

rB Blender

Event Timeline

Brecht Van Lommel (brecht) requested changes to this revision.Aug 18 2019, 3:05 AM

Why not disable this block of code just above? I would guess that's the part really causing the problem, disabling writing to handle->prev_block_rect is an indirect way of doing that.

/* 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) {
  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;
This revision now requires changes to proceed.Aug 18 2019, 3:05 AM

I initially had just chained a third clause to the if condition and then worried about readability.

Brecht is right though, the indirect approach is not more readable because it is less clear.

I've updated the patch to the simple solution.

Thanks for the review!

Cleaning the previous diff, sorry about the noise.

This revision is now accepted and ready to land.Aug 19 2019, 2:50 PM