[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57573] trunk/blender/source/blender/ editors/interface/interface.c: Take precision into account for calculating display of small numbers

Gaia Clary gaia.clary at machinimatrix.org
Wed Jun 19 14:16:51 CEST 2013


Revision: 57573
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57573
Author:   gaiaclary
Date:     2013-06-19 12:16:50 +0000 (Wed, 19 Jun 2013)
Log Message:
-----------
Take precision into account for calculating display of small numbers

Modified Paths:
--------------
    trunk/blender/source/blender/editors/interface/interface.c

Modified: trunk/blender/source/blender/editors/interface/interface.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface.c	2013-06-19 11:53:48 UTC (rev 57572)
+++ trunk/blender/source/blender/editors/interface/interface.c	2013-06-19 12:16:50 UTC (rev 57573)
@@ -453,7 +453,7 @@
 	 * 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. */




More information about the Bf-blender-cvs mailing list