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

Case where gradient is lost #90

Open
ifiddynine opened this issue Jun 16, 2022 · 2 comments
Open

Case where gradient is lost #90

ifiddynine opened this issue Jun 16, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@ifiddynine
Copy link

Hi,

I found an issue where a gradient isn't loaded or rendered correctly, see attached repro case.

<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="40" height="40" rx="6" fill="#18181B"/>
<rect width="40" height="40" rx="6" fill="#9F81DD"/>
<rect width="40" height="40" rx="6" fill="url(#paint0_radial_1325_17657)"/>
<rect width="40" height="40" rx="6" fill="url(#paint1_radial_1325_17657)"/>
<rect width="40" height="40" rx="6" fill="url(#paint2_radial_1325_17657)"/>
<path d="M14 19.25C13.5858 19.25 13.25 19.5858 13.25 20C13.25 20.4142 13.5858 20.75 14 20.75H19.25V26C19.25 26.4142 19.5858 26.75 20 26.75C20.4142 26.75 20.75 26.4142 20.75 26V20.75H26C26.4142 20.75 26.75 20.4142 26.75 20C26.75 19.5858 26.4142 19.25 26 19.25H20.75V14C20.75 13.5858 20.4142 13.25 20 13.25C19.5858 13.25 19.25 13.5858 19.25 14V19.25H14Z" fill="white"/>
<defs>
<radialGradient id="paint0_radial_1325_17657" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(31.8667 33.9535) rotate(-161.408) scale(19.6945 15.4579)">
<stop stop-color="#CE5ACE"/>
<stop offset="1" stop-color="#B139B1" stop-opacity="0"/>
</radialGradient>
<radialGradient id="paint1_radial_1325_17657" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(40 8.60465) rotate(156.196) scale(43.7191 35.479)">
<stop stop-color="#FF075A"/>
<stop offset="1" stop-color="#FC407F" stop-opacity="0"/>
</radialGradient>
<radialGradient id="paint2_radial_1325_17657" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(-2.5133e-07 18.1395) rotate(5.4116) scale(41.9202 87.8269)">
<stop stop-color="#23C9FF"/>
<stop offset="1" stop-color="#60D4FA" stop-opacity="0"/>
</radialGradient>
</defs>
</svg>

add_button

@sammycage sammycage added the bug Something isn't working label Jun 16, 2022
@sammycage
Copy link
Owner

sammycage commented Jun 16, 2022

v.a = v.dr * v.dr - v.dx * v.dx - v.dy * v.dy;
v.inv2a = 1.0 / (2.0 * v.a);

The Radial Gradient mathematics failed here....

@sammycage
Copy link
Owner

Hi @ifiddynine

I reviewed the attached repro case and compared the rendering in Firefox and LunaSVG. However, I'm unable to observe any noticeable differences between the two when the image is rendered.

To better assist you, could you please provide more specific details or highlight the specific bug you are experiencing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants