关闭动画时跳过侧边栏图标过渡动画 (#6581)

Co-authored-by: Glavo <zjx001202@gmail.com>
This commit is contained in:
辞庐 2026-08-02 23:50:26 +08:00 committed by GitHub
parent 81634b14df
commit c8929c80d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -23,6 +23,7 @@ import javafx.animation.Timeline;
import javafx.scene.Parent;
import javafx.scene.shape.SVGPath;
import javafx.util.Duration;
import org.jackhuang.hmcl.ui.animation.AnimationUtils;
import org.jackhuang.hmcl.ui.animation.Motion;
/// A lightweight wrapper for displaying [SVG] icons.
@ -108,7 +109,7 @@ public final class SVGContainer extends Parent {
SVG oldIcon = this.icon;
this.icon = newIcon;
if (animationDuration.equals(Duration.ZERO)) {
if (animationDuration.equals(Duration.ZERO) || !AnimationUtils.isAnimationEnabled()) {
path.setContent(newIcon.getPath());
path.setOpacity(1);
if (getChildren().size() != 1)