Cleanup: Decrease variable scope

This commit is contained in:
Hans Goudey 2021-03-29 18:48:34 -05:00
parent 91c44fe885
commit 7d467915a4
1 changed files with 3 additions and 8 deletions

View File

@ -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, &region->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;
}
/** \} */