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

identical polylines not equally drawn, if coordinates are large #65

Closed
joergk680 opened this issue Nov 15, 2022 · 3 comments
Closed

identical polylines not equally drawn, if coordinates are large #65

joergk680 opened this issue Nov 15, 2022 · 3 comments
Assignees
Labels

Comments

@joergk680
Copy link

joergk680 commented Nov 15, 2022

Hi,
I have two SVG files which look the same in Inkscape but are not drawn equally in SVGImage. The wrong one contains large coordinates.

This is the failing view:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
  viewBox="2506744 5624642 18.459999 7.8600001"
   version="1.1"
   stroke-linecap="round"
   stroke-linejoin="round"
   fill-rule="evenodd"
   xml:space="preserve"
   id="svg29"
   sodipodi:docname="Vermaßung20001_200.svg"
   width="18.459999"
   height="7.8600001"
   inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
   id="namedview31"
   pagecolor="#ffffff"
   bordercolor="#666666"
   borderopacity="1.0"
   inkscape:pageshadow="2"
   inkscape:pageopacity="0.0"
   inkscape:pagecheckerboard="0"
   showgrid="false"
   inkscape:zoom="21.825"
   inkscape:cx="-5.2004582"
   inkscape:cy="19.839633"
   inkscape:window-width="1918"
   inkscape:window-height="1520"
   inkscape:window-x="1913"
   inkscape:window-y="329"
   inkscape:window-maximized="0"
   inkscape:current-layer="svg29" />
<defs
   id="defs5">
<clipPath
   id="clipId0">
<path
   d="m 2506744,5624682 h 49 v -40 h -49 z"
   id="path2" />
</clipPath>
</defs>
<g
   clip-path="url(#clipId0)"
   fill="none"
   stroke="#000000"
   stroke-width="0.01"
   id="g7"
   transform="translate(-25.565,-0.145)" />
<g
   clip-path="url(#clipId0)"
   fill="#00ff00"
   stroke="#00ff00"
   stroke-width="0.01"
   id="g11"
   transform="translate(-25.565,-0.145)">
<text
   transform="matrix(0.13096062,-0.05489367,0.07731503,0.18445158,2506778.5,5624646.1)"
   font-family="Txt, sans-serif"
   font-size="1.38842px"
   id="text9">19.81</text>
</g>
<g
   clip-path="url(#clipId0)"
   fill="none"
   stroke="#00ff00"
   stroke-width="0.01"
   id="g27"
   transform="translate(-25.565,-0.145)">
<polyline
   points="2506787.93,5624642.25 2506769.66,5624649.9 "
   id="polyline13" />
<polyline
   points="2506787.75,5624642.32 2506788.02,5624642.21 "
   id="polyline15" />
<polyline
   points="2506787.97,5624642.34 2506787.89,5624642.15 "
   id="polyline17" />
<polyline
   points="2506787.9,5624642.32 2506787.96,5624642.17 "
   id="polyline19" />
<polyline
   points="2506769.84,5624649.83 2506769.57,5624649.94 "
   id="polyline21" />
<polyline
   points="2506769.62,5624649.81 2506769.7,5624650 "
   id="polyline23" />
<polyline
   points="2506769.69,5624649.82 2506769.63,5624649.98 "
   id="polyline25" />
</g>
</svg>

while this on works fine;

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
   viewBox="44 42 18.459999 7.8600001"
   version="1.1"
   stroke-linecap="round"
   stroke-linejoin="round"
   fill-rule="evenodd"
   xml:space="preserve"
   id="svg29"
   sodipodi:docname="Vermaßung20001_200.svg"
   width="18.459999"
   height="7.8600001"
   inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
   id="namedview31"
   pagecolor="#ffffff"
   bordercolor="#666666"
   borderopacity="1.0"
   inkscape:pageshadow="2"
   inkscape:pageopacity="0.0"
   inkscape:pagecheckerboard="0"
   showgrid="false"
   inkscape:zoom="21.825"
   inkscape:cx="-5.2004582"
   inkscape:cy="19.839633"
   inkscape:window-width="1918"
   inkscape:window-height="1520"
   inkscape:window-x="1913"
   inkscape:window-y="329"
   inkscape:window-maximized="0"
   inkscape:current-layer="svg29" />
<defs
   id="defs5">
<clipPath
   id="clipId0">
<path
   d="m 44,82 h 49 v -40 h -49 z"
   id="path2" />
</clipPath>
</defs>
<g
   clip-path="url(#clipId0)"
   fill="none"
   stroke="#000000"
   stroke-width="0.01"
   id="g7"
   transform="translate(-25.565,-0.145)" />
<g
   clip-path="url(#clipId0)"
   fill="#00ff00"
   stroke="#00ff00"
   stroke-width="0.01"
   id="g11"
   transform="translate(-25.565,-0.145)">
<text
   transform="matrix(0.13096062,-0.05489367,0.07731503,0.18445158,78.5,46.1)"
   font-family="Txt, sans-serif"
   font-size="1.38842px"
   id="text9">19.81</text>
</g>
<g
   clip-path="url(#clipId0)"
   fill="none"
   stroke="#00ff00"
   stroke-width="0.01"
   id="g27"
   transform="translate(-25.565,-0.145)">
<polyline
   points="87.93,42.25 69.66,49.9 "
   id="polyline13" />
<polyline
   points="87.75,42.32 88.02,42.21 "
   id="polyline15" />
<polyline
   points="87.97,42.34 87.89,42.15 "
   id="polyline17" />
<polyline
   points="87.9,42.32 87.96,42.17 "
   id="polyline19" />
<polyline
   points="69.84,49.83 69.57,49.94 "
   id="polyline21" />
<polyline
   points="69.62,49.81 69.7,50 "
   id="polyline23" />
<polyline
   points="69.69,49.82 69.63,49.98 "
   id="polyline25" />
</g>
</svg>

Greetings,
Jörg

@jogibear9988
Copy link
Member

I think this could happen maybe cause of rounding errors, or maybe also wpf xaml images work light differently

@TruePluto
Copy link

I think this is the correct purpose. different view box should show different drawing.
actually this package ignores the viewbox difference show same draw when I modify the svg polyline to right-down cornor.it still stretch to the full region.
I found the SvgImage will ignore all transparent regions. that's annoying。

@jogibear9988
Copy link
Member

With this control it only possible what WPF can do with xaml images. I don't know if your issue is solveable. Maybe if you upload your SVG here someone can look. But I don't know if I find the time. I mostly don't use WPF at the moment.
If you create a Pull, I would merge it.

@paulushub paulushub self-assigned this Oct 25, 2023
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

4 participants