diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2015-08-14 23:09:31 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2015-08-14 23:23:06 +0300 |
commit | d9a720a709c8c4358edb3051c0f2c0daf4482cd2 (patch) | |
tree | c14f8f55cd6e144b59068e57ae08e1093d86ce8c | |
parent | fa86efdc97dee516a747bba3a0bb848fdc5b14a5 (diff) |
Fix T45750: Closing search menu by clicking root button doesn't work when clicking on lower half
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 82660a8eeae..0adbd05d269 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -7225,10 +7225,19 @@ static void ui_blocks_set_tooltips(ARegion *ar, const bool enable) static bool ui_region_contains_point_px(ARegion *ar, int x, int y) { - uiBlock *block; - + uiBlock *block = ar->uiblocks.first; + rcti rect = ar->winrct; + const bool is_block_loop = block->flag & UI_BLOCK_LOOP; + + /* scale down area rect to exclude shadow */ + if (is_block_loop) { + const int shadow_xy = UI_ThemeMenuShadowWidth(); + BLI_rcti_resize(&rect, BLI_rcti_size_x(&ar->winrct) - shadow_xy * 2, + BLI_rcti_size_y(&ar->winrct) - shadow_xy * 2); + } + /* check if the mouse is in the region */ - if (!BLI_rcti_isect_pt(&ar->winrct, x, y)) { + if (!BLI_rcti_isect_pt(&rect, x, y)) { for (block = ar->uiblocks.first; block; block = block->next) block->auto_open = false; |