diff options
author | Harley Acheson <harley.acheson@gmail.com> | 2020-08-28 19:30:51 +0300 |
---|---|---|
committer | Harley Acheson <harley.acheson@gmail.com> | 2020-08-28 19:30:51 +0300 |
commit | c0eb6faa47ecda8cac48e9ce7bb707dfdcbe360f (patch) | |
tree | 7e3b39742fc68bcd83424b459bd3498a2ef8af2b /source/blender | |
parent | 285353c25289c83942af009ead88d2f74ff9f3d8 (diff) |
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
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/interface/interface.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index f076ed083bb..9cede126890 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -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"); } |