Skip to content

Conversation

Eolien55
Copy link
Contributor

Hello,

This pull request includes 2 commits very useful when using high DPIs (7200 is enough to trigger bugs).

The first makes drawquad more aligned with what a true circle quadrant should like using Bézier curves. Moreover, when using high DPIs, the calculations would overflow (especially the sign test). To fix overflow and precision issues, replacing long's by double's is enough.

The second commit fixes pdfpos and pdfunit. For similar reasons, these 2 functions concentrated much of the overflows of neatpdf. Replacing 32-bit integers by 64-bit might have been enough, but the calculations used to simulate decimal numbers are the source of many rounding errors, which are problematic when precision is needed (eg, when using grap). Replacing the long's by double's is, here too, sufficient.

Thanks for the work you put in your very fine pieces of code,
Regards,
Elie Le Vaillant

Eolien55 added 2 commits March 1, 2025 13:30
On some platforms (eg, GCC x86_64), long means 32
bit. This is a problem in pdfpos00, because
calculations such as `uh * 1000 * 72` (in pdfunit)
are likely to overlow, causing important bugs. This
is especially the case when using high dpi values,
such as 720000.
The magic formula was wrong, so the circles looked slightly off.
@Eolien55
Copy link
Contributor Author

Eolien55 commented Mar 1, 2025

Hi, rather than replacing long by doubles, I changed it to long long.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant