Better fix.

This commit is contained in:
Chandler Cox
2024-08-16 07:46:31 -05:00
parent 1047911cfe
commit 7772669148

View File

@@ -143,9 +143,11 @@ namespace FlaxEngine.GUI
if (!Mathf.NearEqual(value, _value))
{
_value = value;
if (!UseSmoothing)
if (!UseSmoothing || _firstUpdate)
{
_current = _value;
if (_firstUpdate)
_firstUpdate = false;
}
}
}
@@ -205,7 +207,7 @@ namespace FlaxEngine.GUI
{
// Lerp or not if running slow
bool isDeltaSlow = deltaTime > (1 / 20.0f);
if (!isDeltaSlow && UseSmoothing && !_firstUpdate)
if (!isDeltaSlow && UseSmoothing)
value = Mathf.Lerp(_current, _value, Mathf.Saturate(deltaTime * 5.0f * SmoothingScale));
_current = value;
}
@@ -216,9 +218,6 @@ namespace FlaxEngine.GUI
}
base.Update(deltaTime);
if (_firstUpdate)
_firstUpdate = false;
}
/// <inheritdoc />