diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-03-13 08:40:30 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-03-13 08:41:46 +0300 |
commit | 2bc6858021f920e3e930db2e466f239a3b9784bd (patch) | |
tree | b1838aed56c6b7b89528c64b1b0af1c02e2f0c6b /source/blender/editors/interface/interface_region_popover.c | |
parent | 1abd120e70faddadad1b20e2b24dd5e03229806e (diff) |
Fix T62524: Popover w/ keep-open moves on cursor motion
Diffstat (limited to 'source/blender/editors/interface/interface_region_popover.c')
-rw-r--r-- | source/blender/editors/interface/interface_region_popover.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/editors/interface/interface_region_popover.c b/source/blender/editors/interface/interface_region_popover.c index e6e7cb33ad5..5710b7c3568 100644 --- a/source/blender/editors/interface/interface_region_popover.c +++ b/source/blender/editors/interface/interface_region_popover.c @@ -193,14 +193,13 @@ static uiBlock *ui_block_func_POPOVER(bContext *C, uiPopupBlockHandle *handle, v } else { /* Not attached to a button. */ - int offset[2] = {0, 0}; + int bounds_offset[2] = {0, 0}; UI_block_flag_enable(block, UI_BLOCK_LOOP); UI_block_theme_style_set(block, UI_BLOCK_THEME_STYLE_POPUP); UI_block_direction_set(block, block->direction); block->minbounds = UI_MENU_WIDTH_MIN; - bool use_place_under_active = !handle->refresh; - if (use_place_under_active) { + if (!handle->refresh) { uiBut *but = NULL; for (but = block->buttons.first; but; but = but->next) { if (but->flag & (UI_SELECT | UI_SELECT_DRAW)) { @@ -209,12 +208,16 @@ static uiBlock *ui_block_func_POPOVER(bContext *C, uiPopupBlockHandle *handle, v } if (but) { - offset[0] = -(but->rect.xmin + 0.8f * BLI_rctf_size_x(&but->rect)); - offset[1] = -(but->rect.ymin + 0.5f * BLI_rctf_size_y(&but->rect)); + bounds_offset[0] = -(but->rect.xmin + 0.8f * BLI_rctf_size_x(&but->rect)); + bounds_offset[1] = -(but->rect.ymin + 0.5f * BLI_rctf_size_y(&but->rect)); } + copy_v2_v2_int(handle->prev_bounds_offset, bounds_offset); + } + else { + copy_v2_v2_int(bounds_offset, handle->prev_bounds_offset); } - UI_block_bounds_set_popup(block, block_margin, offset); + UI_block_bounds_set_popup(block, block_margin, bounds_offset); } return block; |