Code

fix off-by-one error: setting tprec to 6 was actually writing 7 digits
authorbuliabyak <buliabyak@users.sourceforge.net>
Tue, 31 Oct 2006 21:19:40 +0000 (21:19 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Tue, 31 Oct 2006 21:19:40 +0000 (21:19 +0000)
src/svg/svg-length.cpp

index 63af37665f02ce80858654108eebc02e15958acb..3b13e3d89018bbf4889e695f46cb0d8edb8258a3 100644 (file)
@@ -99,7 +99,7 @@ static unsigned sp_svg_number_write_d(gchar *buf, double val, unsigned int tprec
     }
     
     /* Determine the actual number of fractional digits */
-    fprec = MAX(fprec, tprec - idigits);
+    fprec = MAX(fprec, tprec - idigits - 1);
     /* Round value */
     val += 0.5 * pow(10.0, - ((double) fprec));
     /* Extract integral and fractional parts */