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

Dashed line looks different compared to other tools #223

Closed
Skleni opened this issue May 17, 2022 · 2 comments
Closed

Dashed line looks different compared to other tools #223

Skleni opened this issue May 17, 2022 · 2 comments
Assignees

Comments

@Skleni
Copy link

Skleni commented May 17, 2022

I have an SVG file that is displayed differently when using this library compared to other tools:

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 100 20">	
	<line x1="10" y1="10" x2="90" y2="10"
		  style="stroke: #000; stroke-dasharray: 0 5; stroke-linecap: round"/>
</svg>

SharpVectors:

image

Other tools like browsers or svgviewer.dev:

image

After some experiments I think the combination of stroke-linecap: round and having a 0 in the stroke-dasharray is what causes the discrepancy.

@paulushub paulushub self-assigned this May 17, 2022
paulushub added a commit that referenced this issue Jun 1, 2022
@paulushub
Copy link
Contributor

Simply a GDI+ limitation assumed on WPF, which actually renders this correctly.

@Skleni
Copy link
Author

Skleni commented Jun 9, 2022

Thanks!

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