fix #430
This commit is contained in:
parent
9de6989914
commit
40e0c330b2
|
@ -141,8 +141,12 @@ public class GameOption {
|
||||||
/** @return The stored Minecraft GUI scale, also auto-computed if on auto-mode or improper setting */
|
/** @return The stored Minecraft GUI scale, also auto-computed if on auto-mode or improper setting */
|
||||||
public int getGuiScale(int width, int height, int iscale) {
|
public int getGuiScale(int width, int height, int iscale) {
|
||||||
String str = get("guiScale");
|
String str = get("guiScale");
|
||||||
int guiScale = (str == null ? 0 : Integer.parseInt(str));
|
int guiScale;
|
||||||
|
try {
|
||||||
|
guiScale = (str == null ? 0 : Integer.parseInt(str));
|
||||||
|
} catch (NumberFormatException ignore) {
|
||||||
|
guiScale = 0;
|
||||||
|
}
|
||||||
int scale = Math.max(Math.min(width / 320, height / 240), 1);
|
int scale = Math.max(Math.min(width / 320, height / 240), 1);
|
||||||
if (scale < guiScale || guiScale == 0) {
|
if (scale < guiScale || guiScale == 0) {
|
||||||
guiScale = scale;
|
guiScale = scale;
|
||||||
|
|
Loading…
Reference in New Issue