diff options
author | Hans Goudey <h.goudey@me.com> | 2021-03-30 02:48:34 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-03-30 02:48:34 +0300 |
commit | 7d467915a461d003daf26bb9f82afa2e93d4b8ea (patch) | |
tree | 34a6b4d22300c42573b58e4c3508eb3071658f00 /source/blender | |
parent | 91c44fe88547ee4e4d78858d816068876a3db3c4 (diff) |
Cleanup: Decrease variable scope
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/interface/interface_panel.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index 7343417137a..8922babc9b8 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -2529,9 +2529,8 @@ PointerRNA *UI_region_panel_custom_data_under_cursor(const bContext *C, const wm { ARegion *region = CTX_wm_region(C); - Panel *panel = NULL; LISTBASE_FOREACH (uiBlock *, block, ®ion->uiblocks) { - panel = block->panel; + Panel *panel = block->panel; if (panel == NULL) { continue; } @@ -2541,15 +2540,11 @@ PointerRNA *UI_region_panel_custom_data_under_cursor(const bContext *C, const wm ui_window_to_block(region, block, &mx, &my); const int mouse_state = ui_panel_mouse_state_get(block, panel, mx, my); if (ELEM(mouse_state, PANEL_MOUSE_INSIDE_CONTENT, PANEL_MOUSE_INSIDE_HEADER)) { - break; + return UI_panel_custom_data_get(panel); } } - if (panel == NULL) { - return NULL; - } - - return UI_panel_custom_data_get(panel); + return NULL; } /** \} */ |