diff --git a/src/main/java/mod/acgaming/universaltweaks/tweaks/misc/advancements/guisize/UTAdvancementInfo.java b/src/main/java/mod/acgaming/universaltweaks/tweaks/misc/advancements/guisize/UTAdvancementInfo.java index 828329a2..684d06a2 100644 --- a/src/main/java/mod/acgaming/universaltweaks/tweaks/misc/advancements/guisize/UTAdvancementInfo.java +++ b/src/main/java/mod/acgaming/universaltweaks/tweaks/misc/advancements/guisize/UTAdvancementInfo.java @@ -21,9 +21,19 @@ private static int utStepwiseHeight(int height) return height / HEIGHT_MULT * HEIGHT_MULT; } + private static int utClampWidth(int width) + { + return Math.max(width, DEFAULT_WIDTH); + } + + private static int utClampHeight(int height) + { + return Math.max(height, DEFAULT_HEIGHT); + } + public static int utPageWidth(int externalWidth) { - return utStepwiseWidth(externalWidth - UTConfigTweaks.MISC.ADVANCEMENTS.utHorizontalMargin * 2); + return utStepwiseWidth(utClampWidth(externalWidth - UTConfigTweaks.MISC.ADVANCEMENTS.utHorizontalMargin * 2)); } public static int utPageWidth(int externalWidth, int padding) @@ -33,7 +43,7 @@ public static int utPageWidth(int externalWidth, int padding) public static int utPageHeight(int externalHeight) { - return utStepwiseHeight(externalHeight - UTConfigTweaks.MISC.ADVANCEMENTS.utVerticalMargin * 2); + return utStepwiseHeight(utClampHeight(externalHeight - UTConfigTweaks.MISC.ADVANCEMENTS.utVerticalMargin * 2)); } public static int utPageHeight(int externalHeight, int padding)