clamp on return

This commit is contained in:
spatialfree 2022-10-31 04:53:59 -04:00
parent f2e0f69267
commit 695b77894b

View file

@ -286,14 +286,13 @@ public class Design {
float value = PullRequest.Clamp(float.Parse(str), min, max);
// if clamped, update string
if (value != float.Parse(str)) {
// if (str.Contains(".")) {
// str = "";
// }
if (Input.Key(Key.Return).IsJustActive()) {
str = value.ToString();
}
}
return value * unit;
} catch {
return 0;
return MathF.Max(0, min) * unit;
}
}
}