From 7dc8daf1766e123ff94a1d64a3f8228c4151a63a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=CC=84vels=20Nadtoc=CC=8Cajevs?= <7645683+bruvzg@users.noreply.github.com> Date: Mon, 14 Apr 2025 12:11:15 +0300 Subject: [PATCH] [FileSystemList] Fix edit popup not accounting scroll position. --- editor/filesystem_dock.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 8a03d8d8af..ce62ae5163 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -113,6 +113,12 @@ bool FileSystemList::edit_selected() { switch (get_icon_mode()) { case ItemList::ICON_MODE_LEFT: rect = get_item_rect(s, true); + if (get_v_scroll_bar()->is_visible()) { + rect.position.y -= get_v_scroll_bar()->get_value(); + } + if (get_h_scroll_bar()->is_visible()) { + rect.position.x -= get_h_scroll_bar()->get_value(); + } ofs = Vector2(0, Math::floor((MAX(line_editor->get_minimum_size().height, rect.size.height) - rect.size.height) / 2)); popup_rect.position = get_screen_position() + rect.position - ofs; popup_rect.size = rect.size; @@ -123,6 +129,12 @@ bool FileSystemList::edit_selected() { break; case ItemList::ICON_MODE_TOP: rect = get_item_rect(s, false); + if (get_v_scroll_bar()->is_visible()) { + rect.position.y -= get_v_scroll_bar()->get_value(); + } + if (get_h_scroll_bar()->is_visible()) { + rect.position.x -= get_h_scroll_bar()->get_value(); + } popup_rect.position = get_screen_position() + rect.position; popup_rect.size = rect.size;