clamp on return
This commit is contained in:
parent
f2e0f69267
commit
695b77894b
1 changed files with 4 additions and 5 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue