diff options
author | Gaia Clary <gaia.clary@machinimatrix.org> | 2013-06-19 16:16:50 +0400 |
---|---|---|
committer | Gaia Clary <gaia.clary@machinimatrix.org> | 2013-06-19 16:16:50 +0400 |
commit | 5e9e906bd3eb4c1a84156ee13bf8fbdb97f8d704 (patch) | |
tree | 7f3ed5af7a4e093ce54a5826aa4b6cee75e0e31e /source/blender | |
parent | 9d4cc7885dce3237b98e282d79a589f288c6310c (diff) |
Take precision into account for calculating display of small numbers
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/interface/interface.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 834458a3226..8a5f2877f34 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -453,7 +453,7 @@ static int ui_but_float_precision(uiBut *but, double value) * the number, this is so 0.00001 is not displayed as 0.00, * _but_, this is only for small values si 10.0001 will not get * the same treatment */ - if (value != 0.0 && (value = ABS(value)) < 0.1) { + if (value != 0.0 && (value = ABS(value)) < pow(10, -prec)) { int value_i = (int)((value * PRECISION_FLOAT_MAX_POW) + 0.5); if (value_i != 0) { const int prec_span = 3; /* show: 0.01001, 5 would allow 0.0100001 for eg. */ |