Remove caching of ScaledResolution from Window shim
It'll become stale if the code holds on to the Window shim object for a longer duration, and there's no reliable mechanism to invalidate it.
This commit is contained in:
@@ -8,7 +8,6 @@ import org.lwjgl.opengl.Display;
|
|||||||
public class Window implements MainWindowAccessor {
|
public class Window implements MainWindowAccessor {
|
||||||
|
|
||||||
private final Minecraft mc;
|
private final Minecraft mc;
|
||||||
private ScaledResolution scaledResolution;
|
|
||||||
|
|
||||||
public Window(Minecraft mc) {
|
public Window(Minecraft mc) {
|
||||||
this.mc = mc;
|
this.mc = mc;
|
||||||
@@ -52,16 +51,11 @@ public class Window implements MainWindowAccessor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private ScaledResolution scaledResolution() {
|
private ScaledResolution scaledResolution() {
|
||||||
ScaledResolution scaledResolution = this.scaledResolution;
|
//#if MC>=10809
|
||||||
if (scaledResolution == null) {
|
return new ScaledResolution(mc);
|
||||||
//#if MC>=10809
|
//#else
|
||||||
scaledResolution = new ScaledResolution(mc);
|
//$$ return new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
|
||||||
//#else
|
//#endif
|
||||||
//$$ scaledResolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
|
|
||||||
//#endif
|
|
||||||
this.scaledResolution = scaledResolution;
|
|
||||||
}
|
|
||||||
return scaledResolution;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getScaledWidth() {
|
public int getScaledWidth() {
|
||||||
|
|||||||
Reference in New Issue
Block a user