From ecafc9d6f0dd503c31d1fe3ec6a99d2f98ff9384 Mon Sep 17 00:00:00 2001 From: Haowei Wen Date: Tue, 11 Feb 2025 23:51:50 +0800 Subject: [PATCH] Fix height computation in ComponentListCell --- .../org/jackhuang/hmcl/ui/construct/ComponentListCell.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/ComponentListCell.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/ComponentListCell.java index bd97fba09..b1e92a70a 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/ComponentListCell.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/ComponentListCell.java @@ -149,8 +149,8 @@ final class ComponentListCell extends StackPane { } Platform.runLater(() -> { - double newAnimatedHeight = (list.prefHeight(-1) + 8 + 10) * (expanded ? 1 : -1); - double newHeight = expanded ? getHeight() + newAnimatedHeight : prefHeight(-1); + double newAnimatedHeight = (list.prefHeight(list.getWidth()) + 8 + 10) * (expanded ? 1 : -1); + double newHeight = expanded ? getHeight() + newAnimatedHeight : prefHeight(list.getWidth()); double contentHeight = expanded ? newAnimatedHeight : 0; if (expanded) {