[cairo-output-stream] Write out floats to 18 digits after decimal point

We write floats using %f as the scientific format used by smarter %g is
invalid in PS/PDF.  %f however by default rounds to five digits after
decimal point.  This was causing precision loss and making the newly
added degenerate-pen test fail for PDF.  We now print up to 18 digits
which is as many bits doubles can accomodate.  We can be smarter, but
that's for another commit.
This commit is contained in:
Behdad Esfahbod 2007-10-31 02:41:33 -04:00
parent 04793175ac
commit 8297daff89

View file

@ -236,7 +236,7 @@ _cairo_dtostr (char *buffer, size_t size, double d)
if (d == 0.0)
d = 0.0;
snprintf (buffer, size, "%f", d);
snprintf (buffer, size, "%.18f", d);
locale_data = localeconv ();
decimal_point = locale_data->decimal_point;