WIP: UI: TreeView Item Drag Padding #111032
|
@ -300,6 +300,16 @@ uiBut *ui_but_find_mouse_over_ex(const ARegion *region,
|
|||
butover = but;
|
||||
break;
|
||||
}
|
||||
else if (ELEM(but->type, UI_BTYPE_LISTROW, UI_BTYPE_VIEW_ITEM)) {
|
||||
/* Could be in the gaps between these items. */
|
||||
const uiStyle *style = UI_style_get_dpi();
|
||||
rctf rect = but->rect;
|
||||
BLI_rctf_pad(&rect, 0.0f, style->buttonspacey / 2.0f);
|
||||
if (BLI_rctf_isect_pt(&rect, mx, my)) {
|
||||
butover = but;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -456,6 +456,10 @@ std::optional<rctf> AbstractTreeViewItem::get_win_rect(const ARegion ®ion) co
|
|||
rctf win_rect;
|
||||
ui_block_to_window_rctf(®ion, item_but->block, &win_rect, &item_but->rect);
|
||||
|
||||
/* Expand to include the gaps in between items. */
|
||||
const uiStyle *style = UI_style_get_dpi();
|
||||
BLI_rctf_pad(&win_rect, 0.0f, style->buttonspacey / 2.0f);
|
||||
|
||||
return win_rect;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue