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

Question on nsvg__xformInverse for gradient colors #186

Open
chenwu054 opened this issue Sep 28, 2020 · 1 comment
Open

Question on nsvg__xformInverse for gradient colors #186

chenwu054 opened this issue Sep 28, 2020 · 1 comment

Comments

@chenwu054
Copy link

One question on "nsvg__xformInverse(shape->fill.gradient->xform, t);" for gradient paints in nsvg__scaleToViewbox function. I wonder why do we need to do inverse in the "scale" function? Is there any math formula to reference? Thank you!

@memononen
Copy link
Owner

The gradient transform is stored as inverse so that passing a point to it will return a point in gradient space. In retrospect sound wierd, but made sense at the time as I working on the rasterizer.

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

2 participants