UI: prevent softrange from becoming nan

Quiets assert
This commit is contained in:
2016-06-29 12:00:17 +10:00
parent 20f634cfc2
commit 29a73106b4

View File

@@ -2576,9 +2576,11 @@ static void ui_set_but_soft_range(uiBut *but)
}
else if (but->poin && (but->pointype & UI_BUT_POIN_TYPES)) {
float value = ui_but_value_get(but);
CLAMP(value, but->hardmin, but->hardmax);
but->softmin = min_ff(but->softmin, value);
but->softmax = max_ff(but->softmax, value);
if (isfinite(value)) {
CLAMP(value, but->hardmin, but->hardmax);
but->softmin = min_ff(but->softmin, value);
but->softmax = max_ff(but->softmax, value);
}
}
else {
BLI_assert(0);