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

<use> reference id defined inside <defs> does not works #182

Open
dreampiggy opened this issue Sep 30, 2022 · 0 comments
Open

<use> reference id defined inside <defs> does not works #182

dreampiggy opened this issue Sep 30, 2022 · 0 comments

Comments

@dreampiggy
Copy link
Contributor

Expected Behaviour

The rendered circle should be filled with that white blue color

Actual Behaviour

The rendered circle is filled with black color

Reproduce Scenario (including but not limited to)

Steps to Reproduce

see this SVG:

<svg width="200px" height="200px" viewBox="0 0 200 200" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
					<defs>
						<circle id="path-1" cx="100" cy="100" r="100"></circle>
					</defs>
					<g stroke="none" stroke-width="6.000000" fill="none" fill-rule="evenodd">
						<g>
							<use fill-opacity="0.05" fill="#2196F3" xlink:href="#path-1"></use>
							<circle stroke="#2196F3" cx="100" cy="100" r="97"></circle>
							<g transform="translate(69.1754154, 124.78173784999998)" fill="#2196F3" fill-rule="nonzero">
								<path d="M27.29-35.10L33.83-35.10L19.93 0L13.65 0L0.44-35.10L7.24-35.10L15.81-10.03Q16.85-7.01 17.04-4.98L17.04-4.98L17.20-4.98Q17.52-7.65 18.31-9.90L18.31-9.90L27.29-35.10ZM61.41-35.10L67.95-35.10L54.05 0L47.77 0L34.56-35.10L41.35-35.10L49.92-10.03Q50.97-7.01 51.16-4.98L51.16-4.98L51.32-4.98Q51.64-7.65 52.43-9.90L52.43-9.90L61.41-35.10Z"></path>
							</g>
						</g>
					</g>
				</svg>

It seems render the wrong result compared to Chrome.

A little change can workaround it by removing use and defs, using the embed attribute:

<circle id="path-1" cx="100" cy="100" r="100" fill-opacity="0.05" fill="#2196F3"></circle>

Platform and Version

commit: master, d234cff
platform: iOS/macOS/tvOS/watchOS, CoreGraphics port

Sample Code that illustrates the problem

Logs taken while reproducing problem

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

1 participant