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);
|
float value = PullRequest.Clamp(float.Parse(str), min, max);
|
||||||
// if clamped, update string
|
// if clamped, update string
|
||||||
if (value != float.Parse(str)) {
|
if (value != float.Parse(str)) {
|
||||||
// if (str.Contains(".")) {
|
if (Input.Key(Key.Return).IsJustActive()) {
|
||||||
// str = "";
|
str = value.ToString();
|
||||||
// }
|
}
|
||||||
str = value.ToString();
|
|
||||||
}
|
}
|
||||||
return value * unit;
|
return value * unit;
|
||||||
} catch {
|
} catch {
|
||||||
return 0;
|
return MathF.Max(0, min) * unit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue