diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/tree/DarkTreeUI.java b/core/src/main/java/com/github/weisj/darklaf/ui/tree/DarkTreeUI.java index 9647cb39..061ec31c 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/tree/DarkTreeUI.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/tree/DarkTreeUI.java @@ -694,17 +694,15 @@ public class DarkTreeUI extends BasicTreeUI implements PropertyChangeListener, C protected void scrollRowToVisible(final JTree tree, final int row) { Rectangle bounds = tree.getRowBounds(row); - if (!isLeaf(tree, row)) { - boolean expanded = tree.isExpanded(row); - BasicTreeUI ui = DarkUIUtil.getUIOfType(tree.getUI(), BasicTreeUI.class); - if (ui != null) { - Icon icon = expanded ? ui.getExpandedIcon() : ui.getCollapsedIcon(); - boolean ltr = tree.getComponentOrientation().isLeftToRight(); - int ident = ui.getRightChildIndent(); - int extra = ident - 1 + icon.getIconWidth() / 2; - if (ltr) bounds.x -= extra; - bounds.width += extra; - } + boolean expanded = tree.isExpanded(row); + BasicTreeUI ui = DarkUIUtil.getUIOfType(tree.getUI(), BasicTreeUI.class); + if (ui != null) { + Icon icon = expanded ? ui.getExpandedIcon() : ui.getCollapsedIcon(); + boolean ltr = tree.getComponentOrientation().isLeftToRight(); + int ident = ui.getRightChildIndent(); + int extra = ident - 1 + icon.getIconWidth() / 2; + if (ltr) bounds.x -= extra; + bounds.width += extra; } tree.scrollRectToVisible(bounds); }