summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2009-11-16 12:31:18 (GMT)
committerGunnar Sletta <gunnar@trolltech.com>2009-11-16 12:31:18 (GMT)
commitde43f6f89e1344045f0fb5a319a44e5d604d414e (patch)
treed11b50df9005115ec9434e326572ca2873c626b1
parentbecf7dc2b4b7c2609350eb3236f854c1a4a344f5 (diff)
downloadQt-de43f6f89e1344045f0fb5a319a44e5d604d414e.zip
Qt-de43f6f89e1344045f0fb5a319a44e5d604d414e.tar.gz
Qt-de43f6f89e1344045f0fb5a319a44e5d604d414e.tar.bz2
Fixed double precision problems in pdf printing
Increased the precision of the output to 9 decimals. Not ideal but better than just 6. Reviewed-by: Trond
-rw-r--r--src/gui/painting/qpdf.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp
index b640858..d45bd10 100644
--- a/src/gui/painting/qpdf.cpp
+++ b/src/gui/painting/qpdf.cpp
@@ -78,8 +78,8 @@ const char *qt_real_to_string(qreal val, char *buf) {
unsigned int ival = (unsigned int) val;
qreal frac = val - (qreal)ival;
- int ifrac = (int)(frac * 1000000);
- if (ifrac == 1000000) {
+ int ifrac = (int)(frac * 1000000000);
+ if (ifrac == 1000000000) {
++ival;
ifrac = 0;
}
@@ -90,7 +90,7 @@ const char *qt_real_to_string(qreal val, char *buf) {
++i;
ival /= 10;
}
- int fact = 100000;
+ int fact = 100000000;
if (i == 0) {
*(buf++) = '0';
} else {