From f5131cdee010d0fb83239310b9b93570b308ccce Mon Sep 17 00:00:00 2001 From: Harley Acheson Date: Tue, 4 Jun 2024 20:28:12 +0200 Subject: [PATCH] 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 --- source/blender/editors/interface/interface_panel.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/interface/interface_panel.cc b/source/blender/editors/interface/interface_panel.cc index e8d9bb00bf4..75c43f099f8 100644 --- a/source/blender/editors/interface/interface_panel.cc +++ b/source/blender/editors/interface/interface_panel.cc @@ -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)) {