From aa97ec3d18541f82a7380a4376ea2fc10ccb0070 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Sat, 29 Oct 2022 15:23:25 +0200 Subject: [PATCH] Select position dialog - better scroll to selection --- .../decompiler/flash/gui/SelectTagPositionDialog.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/com/jpexs/decompiler/flash/gui/SelectTagPositionDialog.java b/src/com/jpexs/decompiler/flash/gui/SelectTagPositionDialog.java index cce09997d..70a97e96c 100644 --- a/src/com/jpexs/decompiler/flash/gui/SelectTagPositionDialog.java +++ b/src/com/jpexs/decompiler/flash/gui/SelectTagPositionDialog.java @@ -250,7 +250,13 @@ public class SelectTagPositionDialog extends AppDialog { Object[] pathArray = subPath.toArray(new Object[subPath.size()]); TreePath tpath = new TreePath(pathArray); positionTree.setSelectionPath(tpath); - positionTree.scrollPathToVisible(tpath); + int row = positionTree.getRowForPath(tpath); + if (row != -1) { + Rectangle rect = positionTree.getRowBounds(row); + rect.width += rect.x; + rect.x = 0; + positionTree.scrollRectToVisible(rect); + } return; }