Improve Y Padding
All checks were successful
EnergonRelics/pipeline/head This commit looks good

This commit is contained in:
TheBrokenRail 2020-08-01 23:26:30 -04:00
parent 1e78023ee4
commit fdad30c27f

View File

@ -67,10 +67,14 @@ class EnergyTeleporter {
float multiplier = (float) newPaddedHeight / (float) oldPaddedHeight; float multiplier = (float) newPaddedHeight / (float) oldPaddedHeight;
y = y - bottomPadding;
y = (int) (y * multiplier); y = (int) (y * multiplier);
int newMax = newHeight - topPadding; int newMax = newHeight - topPadding;
y = y + bottomPadding;
y = MathHelper.clamp(y, bottomPadding, newMax); y = MathHelper.clamp(y, bottomPadding, newMax);
return y; return y;