mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-26 14:20:54 +01:00
[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:
parent
04793175ac
commit
8297daff89
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue