Remove this parameter from FloatMath.Clamp.

That was a stupid idea.
This commit is contained in:
Pieter-Jan Briers
2020-08-12 21:15:26 +02:00
parent f182ff5613
commit e76003948b
5 changed files with 5 additions and 5 deletions

View File

@@ -122,7 +122,7 @@ namespace Content.Client.Chat
var screenPos = lowerCenter - (Width / 2, ContentHeight + _verticalOffsetAchieved); var screenPos = lowerCenter - (Width / 2, ContentHeight + _verticalOffsetAchieved);
LayoutContainer.SetPosition(this, screenPos); LayoutContainer.SetPosition(this, screenPos);
var height = (lowerCenter.Y - screenPos.Y).Clamp(0, ContentHeight); var height = FloatMath.Clamp(lowerCenter.Y - screenPos.Y, 0, ContentHeight);
LayoutContainer.SetSize(this, (Size.X, height)); LayoutContainer.SetSize(this, (Size.X, height));
} }

View File

@@ -244,7 +244,7 @@ namespace Content.Client.GameObjects.Components
if (int.TryParse(ev.Text, out var result)) if (int.TryParse(ev.Text, out var result))
{ {
result = result.Clamp(0, byte.MaxValue); result = FloatMath.Clamp(result, 0, byte.MaxValue);
_ignoreEvents = true; _ignoreEvents = true;
_colorValue = (byte) result; _colorValue = (byte) result;

View File

@@ -152,7 +152,7 @@ namespace Content.Client.GameObjects.Components.Mobs
var progress = (_gameTiming.CurTime - start).TotalSeconds / length; var progress = (_gameTiming.CurTime - start).TotalSeconds / length;
var ratio = (progress <= 1 ? (1 - progress) : (_gameTiming.CurTime - end).TotalSeconds * -5); var ratio = (progress <= 1 ? (1 - progress) : (_gameTiming.CurTime - end).TotalSeconds * -5);
cooldownGraphic.Progress = (float)ratio.Clamp(-1, 1); cooldownGraphic.Progress = FloatMath.Clamp((float)ratio, -1, 1);
cooldownGraphic.Visible = ratio > -1f; cooldownGraphic.Visible = ratio > -1f;
} }
} }

View File

@@ -112,7 +112,7 @@ namespace Content.Client.UserInterface
var progress = (_gameTiming.CurTime - start).TotalSeconds / length; var progress = (_gameTiming.CurTime - start).TotalSeconds / length;
var ratio = (progress <= 1 ? (1 - progress) : (_gameTiming.CurTime - end).TotalSeconds * -5); var ratio = (progress <= 1 ? (1 - progress) : (_gameTiming.CurTime - end).TotalSeconds * -5);
cooldownDisplay.Progress = (float)ratio.Clamp(-1, 1); cooldownDisplay.Progress = FloatMath.Clamp((float)ratio, -1, 1);
if (ratio > -1f) if (ratio > -1f)
{ {

View File

@@ -60,7 +60,7 @@ namespace Content.Server.Preferences
await _prefsSemaphore.WaitAsync(); await _prefsSemaphore.WaitAsync();
try try
{ {
index = index.Clamp(0, _maxCharacterSlots - 1); index = FloatMath.Clamp(index, 0, _maxCharacterSlots - 1);
await _prefsDb.SaveSelectedCharacterIndex(username, index); await _prefsDb.SaveSelectedCharacterIndex(username, index);
} }
finally finally