mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-17 07:47:57 -04:00
删除 DecoratorController 中的背景图缓存 (#2710)
This commit is contained in:
parent
7556ef21c4
commit
0bcda9eb46
@ -183,8 +183,6 @@ public class DecoratorController {
|
||||
return new Background(new BackgroundImage(image, BackgroundRepeat.NO_REPEAT, BackgroundRepeat.NO_REPEAT, BackgroundPosition.DEFAULT, new BackgroundSize(800, 480, false, false, true, true)));
|
||||
}
|
||||
|
||||
private volatile Image defaultBackground;
|
||||
|
||||
/**
|
||||
* Load background image from bg/, background.png, background.jpg, background.gif
|
||||
*/
|
||||
@ -199,12 +197,7 @@ public class DecoratorController {
|
||||
if (!image.isPresent()) {
|
||||
image = tryLoadImage(Paths.get("background.gif"));
|
||||
}
|
||||
|
||||
return image.orElseGet(() -> {
|
||||
if (defaultBackground == null)
|
||||
defaultBackground = newBuiltinImage("/assets/img/background.jpg");
|
||||
return defaultBackground;
|
||||
});
|
||||
return image.orElseGet(() -> newBuiltinImage("/assets/img/background.jpg"));
|
||||
}
|
||||
|
||||
private Optional<Image> randomImageIn(Path imageDir) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user