[Forge size fix] Set overrideWidth and overrideHeight auto

This commit is contained in:
khanhduytran0 2020-12-06 20:37:08 +07:00
parent ba017126ea
commit 49974f0393
7 changed files with 64 additions and 16 deletions

View file

@ -137,6 +137,10 @@ public class BaseMainActivity extends LoggableActivity {
CallbackBridge.windowHeight = displayMetrics.heightPixels / scaleFactor;
System.out.println("WidthHeight: " + CallbackBridge.windowWidth + ":" + CallbackBridge.windowHeight);
MCOptionUtils.INSTANCE.set("overrideWidth", Integer.toString(CallbackBridge.windowWidth));
MCOptionUtils.INSTANCE.set("overrideHeight", Integer.toString(CallbackBridge.windowHeight));
MCOptionUtils.INSTANCE.save();
gestureDetector = new GestureDetector(this, new SingleTapConfirm());
// Menu
@ -726,7 +730,6 @@ public class BaseMainActivity extends LoggableActivity {
minecraftGLView.setOnGenericMotionListener(gmlistener);
touchPad.setOnGenericMotionListener(gmlistener);
} catch (Throwable e) {
e.printStackTrace();
Tools.showError(this, e, true);
}
}