Skip to content
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

Wrong coordinates for radial gradients #122

Open
gioele opened this issue Apr 28, 2020 · 4 comments
Open

Wrong coordinates for radial gradients #122

gioele opened this issue Apr 28, 2020 · 4 comments

Comments

@gioele
Copy link

gioele commented Apr 28, 2020

The coordinates in radial gradients are off. As you can see by comparing the SVG and the PDF renderings (especially the gradient in the fingers) the focus of the radial gradients are not where they should be and the colors appear almost flat.

Maybe the unit scaling of the context hasn't been applied?

There is a reproducible test case + script at https://gist.github.com/gioele/9e412c1a902d67377f73cc93087cd582.

BTW, thank you for implementing radial gradients in the first place ❤️!

@mogest
Copy link
Owner

mogest commented Jul 4, 2020

Hi @gioele, thanks so much for reporting and sorry it's taken a while to get to.

This has been a frustrating one to diagnose. I've narrowed it down to gradientTransform not working properly in some specific cases, for neither linear nor radial gradients. I've got a few more paths to look down, and will keep you up to date on how I'm going.

@jwright6323
Copy link

This seems related to an issue I ran into; the gradient seems to be rendered differently based on the image's location on the page. Here's a gist of that condition: https://gist.github.com/jwright6323/666747665d920d6bc294959be24f6822

@mogest
Copy link
Owner

mogest commented Apr 8, 2023

Hi @jwright6323, sorry to say that it's not related. I totally forgot about this bug, and have re-replicated it, and confirmed it has to do with thegradientTransform not being applied correctly. Your SVG doesn't use this attribute. It might be another problem, but I did some quick tests and couldn't replicate it using SVG.

If you can supply an SVG that exhibits the problem then I'm happy to look further into it.

@jwright6323
Copy link

Thanks. I filed #153 for this separate issue, then.

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

No branches or pull requests

3 participants