Update CloseTo to CloseToPercent (#4708)

This commit is contained in:
metalgearsloth
2021-09-29 20:07:01 +10:00
committed by GitHub
parent fe4a415d3b
commit ad783396f8
18 changed files with 31 additions and 31 deletions

View File

@@ -101,7 +101,7 @@ namespace Content.Client.Chat.UI
}
// Lerp to our new vertical offset if it's been modified.
if (MathHelper.CloseTo(_verticalOffsetAchieved - VerticalOffset, 0, 0.1))
if (MathHelper.CloseToPercent(_verticalOffsetAchieved - VerticalOffset, 0, 0.1))
{
_verticalOffsetAchieved = VerticalOffset;
}

View File

@@ -140,7 +140,7 @@ namespace Content.Client.EscapeMenu.UI.Tabs
var isFullscreenSame = FullscreenCheckBox.Pressed == ConfigIsFullscreen;
var isLightingQualitySame = LightingPresetOption.SelectedId == GetConfigLightingQuality();
var isHudThemeSame = HudThemeOption.SelectedId == _cfg.GetCVar(CCVars.HudTheme);
var isUIScaleSame = MathHelper.CloseTo(UIScaleOptions[UIScaleOption.SelectedId], ConfigUIScale);
var isUIScaleSame = MathHelper.CloseToPercent(UIScaleOptions[UIScaleOption.SelectedId], ConfigUIScale);
var isVPStretchSame = ViewportStretchCheckBox.Pressed == _cfg.GetCVar(CCVars.ViewportStretch);
var isVPScaleSame = (int) ViewportScaleSlider.Value == _cfg.GetCVar(CCVars.ViewportFixedScaleFactor);
var isIntegerScalingSame = IntegerScalingCheckBox.Pressed == (_cfg.GetCVar(CCVars.ViewportSnapToleranceMargin) != 0);
@@ -215,7 +215,7 @@ namespace Content.Client.EscapeMenu.UI.Tabs
{
for (var i = 0; i < UIScaleOptions.Length; i++)
{
if (MathHelper.CloseTo(UIScaleOptions[i], value))
if (MathHelper.CloseToPercent(UIScaleOptions[i], value))
{
return i;
}

View File

@@ -263,7 +263,7 @@ namespace Content.Client.Tabletop
var max = (eyePosition + size / 2) / eyeScale;
// If 90/270 degrees rotated, flip X and Y
if (MathHelper.CloseTo(eyeRotation.Degrees % 180d, 90d) || MathHelper.CloseTo(eyeRotation.Degrees % 180d, -90d))
if (MathHelper.CloseToPercent(eyeRotation.Degrees % 180d, 90d) || MathHelper.CloseToPercent(eyeRotation.Degrees % 180d, -90d))
{
(min.Y, min.X) = (min.X, min.Y);
(max.Y, max.X) = (max.X, max.Y);