From d9e8291178937702c7ef3508e2341eb679780a1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Sat, 28 Jan 2023 13:24:35 +0100 Subject: [PATCH] Fixed #1944 Scroll position not retained on Ctrl+click in the tag tree --- CHANGELOG.md | 2 ++ src/com/jpexs/decompiler/flash/gui/MainPanel.java | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e5263cc4..a8ddc7296 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ All notable changes to this project will be documented in this file. - [#1888] String casts - ConvertS on XML, XMLList - [#1953] Save as EXE - add file extension when missing - [#1954] Incorrect calculation of empty button bounds causing OutOfMemory +- [#1944] Scroll position not retained on Ctrl+click in the tag tree ## [18.3.3] - 2023-01-22 ### Added @@ -2925,6 +2926,7 @@ All notable changes to this project will be documented in this file. [#1888]: https://www.free-decompiler.com/flash/issues/1888 [#1953]: https://www.free-decompiler.com/flash/issues/1953 [#1954]: https://www.free-decompiler.com/flash/issues/1954 +[#1944]: https://www.free-decompiler.com/flash/issues/1944 [#1913]: https://www.free-decompiler.com/flash/issues/1913 [#1894]: https://www.free-decompiler.com/flash/issues/1894 [#1801]: https://www.free-decompiler.com/flash/issues/1801 diff --git a/src/com/jpexs/decompiler/flash/gui/MainPanel.java b/src/com/jpexs/decompiler/flash/gui/MainPanel.java index 7efef4bf2..41d8db0d1 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/MainPanel.java @@ -4497,7 +4497,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se updateUi(); } - reload(false); + reload(false, false); if (source == dumpTree) { TreeItem t = null; @@ -5017,6 +5017,10 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se } public void reload(boolean forceReload) { + reload(forceReload, true); + } + + public void reload(boolean forceReload, boolean scrollToVisible) { View.checkAccess(); JScrollBar folderPreviewScrollBar = ((JScrollPane)folderPreviewPanel.getParent().getParent()).getVerticalScrollBar(); @@ -5024,7 +5028,9 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se Map folderItems = new HashMap<>(folderPreviewPanel.selectedItems); - tagTree.scrollPathToVisible(tagTree.getSelectionPath()); + if (scrollToVisible) { + tagTree.scrollPathToVisible(tagTree.getSelectionPath()); + } if (currentView == VIEW_DUMP) { dumpViewReload(forceReload); return;