From 5a60f66cb1c85a942c66081ca390ea62a6ec8583 Mon Sep 17 00:00:00 2001 From: Anastasia Calico Date: Sun, 9 Nov 2025 19:21:42 +1100 Subject: [PATCH] fix: Fix lag when resizing PanoramaViewerScreen. #57. --- .../snapper/gui/screen/PanoramaViewerScreen.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/client/java/dev/spiritstudios/snapper/gui/screen/PanoramaViewerScreen.java b/src/client/java/dev/spiritstudios/snapper/gui/screen/PanoramaViewerScreen.java index 9b62c8e..d45ecb9 100644 --- a/src/client/java/dev/spiritstudios/snapper/gui/screen/PanoramaViewerScreen.java +++ b/src/client/java/dev/spiritstudios/snapper/gui/screen/PanoramaViewerScreen.java @@ -39,6 +39,9 @@ protected PanoramaViewerScreen(String title, Screen parent) { this.client = MinecraftClient.getInstance(); assert client != null; this.texture = this.getTexture(); + if (texture != null) { + client.getTextureManager().registerTexture(ID, texture); + } } @Nullable @@ -75,6 +78,7 @@ public void close() { @Override protected void init() { + // This is called whenever the window is resized. assert client != null; if (this.texture == null) { @@ -82,7 +86,6 @@ protected void init() { close(); return; } - client.getTextureManager().registerTexture(ID, texture); Path panoramaPath = Path.of(client.runDirectory.getPath(), "screenshots", "panorama"); addDrawableChild(ButtonWidget.builder(Text.translatable("button.snapper.folder"), button -> {