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

Draw Svg in Svg with different ViewBox #1108

Open
Appendme opened this issue Dec 14, 2023 · 0 comments
Open

Draw Svg in Svg with different ViewBox #1108

Appendme opened this issue Dec 14, 2023 · 0 comments
Labels

Comments

@Appendme
Copy link

Description

There is a situation when you need to draw an SVG that contains an SVG inside, but with a larger ViewBox size. Resvg and Chrome draw the same, but Svg.Net does not. Is this some kind of error that these libraries can solve, but Svg.net can’t, or is this a bug in Svg.Net?

Example data

Original picture:

<svg xmlns="http://www.w3.org/2000/svg" width="400" height="400" viewBox="0 0 124 124">
  <rect width="124" height="124" rx="24" fill="#F97316"/>
  <svg x="62" y="62" width="800" viewBox="0 0 600 600" preserveAspectRatio="xMinYMin">
    <circle cx="63.2109" cy="37.5391" r="18.1641" fill="black"/>
  </svg>
</svg>

Approximately what Svg.Net produces:

<svg xmlns="http://www.w3.org/2000/svg" width="400" height="400" viewBox="0 0 124 124">
  <rect width="124" height="124" rx="24" fill="#F97316"/>
  <svg x="62" y="62" width="800" viewBox="0 0 124 124" preserveAspectRatio="xMinYMin">
    <circle cx="63.2109" cy="37.5391" r="18.1641" fill="black"/>
  </svg>
</svg>

Used Versions

OS: Windows 11
DotNet Core 8
Render: Svg.Skia

@paulushub paulushub added the bug label Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants