UI: Do Not Display Negative Zero Floats

Display negative zero floats as regular zero. Does not alter underlying value.

Differential Revision: https://developer.blender.org/D4795

Reviewed by Brecht Van Lommel
This commit is contained in:
Harley Acheson 2020-08-28 09:30:51 -07:00
parent 285353c252
commit c0eb6faa47
1 changed files with 3 additions and 0 deletions

View File

@ -3481,6 +3481,9 @@ static void ui_but_build_drawstr_float(uiBut *but, double value)
subtype = RNA_property_subtype(but->rnaprop);
}
/* Change negative zero to regular zero, without altering anything else. */
value += +0.0f;
if (value == (double)FLT_MAX) {
STR_CONCAT(but->drawstr, slen, "inf");
}