Skip to content

Commit

Permalink
prevent shrinking size below vanilla default
Browse files Browse the repository at this point in the history
  • Loading branch information
WaitingIdly committed Jun 22, 2024
1 parent 99dc396 commit da18e87
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit da18e87

Please sign in to comment.