You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having problems with repeated gradients not quite lining up with their parent containers.
For instance, if I have a 144pt tall div, and I want a linear gradient (set to bottom) gradient to repeat 10 times, I'd set background-size to 100% 14.4pt. This should create 10 perfectly spaced lines, starting from the top of the container. However, when Weasyprint renders it the spaces are just too large, causing it to look misaligned.
However, if I had a 150pt tall div and I used 15pt at the spacing, it works perfectly. Ditto with 125pt and 12.5pt spacing. However, 2in and 0.2in fails just like 144pt and 14.4pt. It appears that the background size is being rounded to some fraction of a point, which builds up and causes misalignments.
I'm running on Windows 10 using Python 3.6 and Weasyprint 44.
It's because we use patterns and don't repeat images and gradients manually.
I first thought that it was because we use a PDFSurface to draw our patterns, and that PDFSurfaces have a size rounded to points. But the problem happens with a RecordingSurface too, so…
We can manually repeat images. I've tested and it works, it's not perfect (we still have small rounding problems, maybe caused by the PDF reader) but it's much better.
I'm having problems with repeated gradients not quite lining up with their parent containers.
For instance, if I have a 144pt tall div, and I want a linear gradient (set
to bottom
) gradient to repeat 10 times, I'd setbackground-size
to100% 14.4pt
. This should create 10 perfectly spaced lines, starting from the top of the container. However, when Weasyprint renders it the spaces are just too large, causing it to look misaligned.However, if I had a 150pt tall div and I used 15pt at the spacing, it works perfectly. Ditto with 125pt and 12.5pt spacing. However, 2in and 0.2in fails just like 144pt and 14.4pt. It appears that the background size is being rounded to some fraction of a point, which builds up and causes misalignments.
I'm running on Windows 10 using Python 3.6 and Weasyprint 44.
Here's the test case file:
And here's the output.
The text was updated successfully, but these errors were encountered: