From a60ec16858c364bbecfa3379c6309e08fe1c1563 Mon Sep 17 00:00:00 2001 From: Harley Acheson Date: Fri, 4 Jul 2025 19:50:44 +0200 Subject: [PATCH] Fix #141225: Hide Right Node Editor Scrollbars When Sidebar Visible For Node Editors do not show right-side scrollbars if region overlap and there is a right-aligned region open, to avoid two scrollbars. Pull Request: https://projects.blender.org/blender/blender/pulls/141418 --- .../blender/editors/space_node/node_draw.cc | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/source/blender/editors/space_node/node_draw.cc b/source/blender/editors/space_node/node_draw.cc index eb22ff85eac..93ae67ad6a8 100644 --- a/source/blender/editors/space_node/node_draw.cc +++ b/source/blender/editors/space_node/node_draw.cc @@ -5483,6 +5483,27 @@ void node_draw_space(const bContext &C, ARegion ®ion) } /* Scrollers. */ + + /* Hide the right scrollbar while a right-aligned region + * is open. Otherwise we can have two scroll bars. #141225 */ + ScrArea *area = CTX_wm_area(&C); + bool sidebar = false; + LISTBASE_FOREACH (ARegion *, region, &area->regionbase) { + if (region->alignment == RGN_ALIGN_RIGHT && region->overlap && + !(region->flag & RGN_FLAG_HIDDEN)) + { + sidebar = true; + break; + } + } + + if (sidebar) { + v2d.scroll &= ~V2D_SCROLL_RIGHT; + } + else { + v2d.scroll |= V2D_SCROLL_RIGHT; + } + UI_view2d_scrollers_draw(&v2d, nullptr); }