-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linear gradient with repeated stops with offset="0"
does not render
#151
Comments
I can confirm that this doesn't work. I guess the important part of the spec is the following. It also hints at the workaround or possible implementation in the conversion:
|
Interestingly this seems to work with values which are not |
@yGuy We could replace the second offset with a very low number, but I see now that there is also a difference in the gradient produced then: playground. |
You're right; both (at least Chrome) and the PDF are wrong and behave against the spec. Even with both offsets at exactly 0 you should not be seeing this thin red line in the SVG and the PDF seems to round up the value to about 0.05 |
jsPDF linearly samples the gradient colors, which is why very hard edges are washed out. As a fix we should probably implement the workaround @yGuy mentioned. When there are multiple stops at |
Describe the bug
Linear gradient with repeated stops with
offset="0"
does not render.To Reproduce
See this playground.
Expected behavior
I would have expected the PDF to render the same way as the SVG.
This is in accordance to the following SVG spec: https://www.w3.org/TR/SVG2/pservers.html#StopNotes.
Desktop:
The text was updated successfully, but these errors were encountered: