Fix #5256: 修复使用 GIF 背景时调整背景不透明度导致启动器崩溃的问题 (#5262)

This commit is contained in:
Glavo
2026-01-19 21:21:23 +08:00
committed by GitHub
parent e778d223a7
commit 6f402cd218

View File

@@ -264,7 +264,7 @@ public class DecoratorController {
private Background createBackgroundWithOpacity(Image image, int opacity) { private Background createBackgroundWithOpacity(Image image, int opacity) {
if (opacity <= 0) { if (opacity <= 0) {
return new Background(new BackgroundFill(new Color(1, 1, 1, 0), CornerRadii.EMPTY, Insets.EMPTY)); return new Background(new BackgroundFill(new Color(1, 1, 1, 0), CornerRadii.EMPTY, Insets.EMPTY));
} else if (opacity >= 100) { } else if (opacity >= 100 || image.getPixelReader() == null) {
return new Background(new BackgroundImage( return new Background(new BackgroundImage(
image, image,
BackgroundRepeat.NO_REPEAT, BackgroundRepeat.NO_REPEAT,