Fix #122411: Sub-panels Not Clickable When Popover is Scaled

When a popover includes panels, the calculation of whether the mouse
is over the panel header does not take into consideration local 2D
scaling. Therefore the hit area is in the wrong location if scaled.

Pull Request: https://projects.blender.org/blender/blender/pulls/122696
This commit is contained in:
Harley Acheson
2024-06-04 20:28:12 +02:00
committed by Harley Acheson
parent dd9ea5de6b
commit f5131cdee0

View File

@@ -1997,8 +1997,9 @@ static void ui_do_drag(const bContext *C, const wmEvent *event, Panel *panel)
LayoutPanelHeader *ui_layout_panel_header_under_mouse(const Panel &panel, const int my)
{
const float aspect = panel.runtime->block->aspect;
for (LayoutPanelHeader &header : panel.runtime->layout_panels.headers) {
if (IN_RANGE(float(my - panel.runtime->block->rect.ymax + layout_panel_y_offset()),
if (IN_RANGE(float(my - panel.runtime->block->rect.ymax + layout_panel_y_offset()) * aspect,
header.start_y,
header.end_y))
{