[rkward-cvs] SF.net SVN: rkward: [1347] trunk/rkward/rkward/misc/rkspinbox.cpp

tfry at users.sourceforge.net tfry at users.sourceforge.net
Wed Feb 7 19:22:36 UTC 2007


Revision: 1347
          http://svn.sourceforge.net/rkward/?rev=1347&view=rev
Author:   tfry
Date:     2007-02-07 11:22:36 -0800 (Wed, 07 Feb 2007)

Log Message:
-----------
Don't screw up on negative values

Modified Paths:
--------------
    trunk/rkward/rkward/misc/rkspinbox.cpp

Modified: trunk/rkward/rkward/misc/rkspinbox.cpp
===================================================================
--- trunk/rkward/rkward/misc/rkspinbox.cpp	2007-02-07 12:54:36 UTC (rev 1346)
+++ trunk/rkward/rkward/misc/rkspinbox.cpp	2007-02-07 19:22:36 UTC (rev 1347)
@@ -66,7 +66,7 @@
 
 			int power;
 			if (real_value != 0) {
-				power = (int) log10 (real_value) - default_precision;
+				power = (int) log10 (fabs (real_value)) - default_precision;
 				if (power < (-default_precision)) power = -default_precision;
 				if (power > 10) power = 10;
 			} else {
@@ -86,7 +86,7 @@
 		QSpinBox::updateDisplay ();
 
 		int power;
-		if (value () != 0) power = (int) log10 (value ());
+		if (value () != 0) power = (int) log10 (abs (value ()));
 		else power = 1;
 		int step = (int) pow (10, power-1);
 		if (step < 1) step = 1;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list