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

SVG clipping is not working #12

Open
b2yq opened this issue Apr 21, 2022 · 2 comments
Open

SVG clipping is not working #12

b2yq opened this issue Apr 21, 2022 · 2 comments

Comments

@b2yq
Copy link

b2yq commented Apr 21, 2022

Svg clipping is not working. Library is rendering image and ignroing clipping

Tested on Xamarin Android with Vapolia.Xamarin.Svg ver 4.1.0, 4.0.11, 4.0.2
Example svg:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
   width="300"
   height="300"
   viewBox="0 0 79.374998 79.375002"
   version="1.1"
   id="svg5"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:svg="http://www.w3.org/2000/svg">
  <defs
     id="defs2">
    <clipPath
       clipPathUnits="userSpaceOnUse"
       id="clipPath1549">
      <path
         id="path1551"
         style="fill:#000086;stroke-width:0.926042;stroke-linecap:round;stroke-dasharray:3.70417, 3.70417"
         d="m 47.044642,3.8209318 h 40.676015 c 4.437083,0 8.009175,3.5720922 8.009175,8.0091752 v 32.311275 c 0,4.437081 -3.572092,8.009173 -8.009175,8.009173 H 47.044642 c -4.437084,0 -8.009176,-3.572092 -8.009176,-8.009173 V 11.830107 c 0,-4.437083 3.572092,-8.0091752 8.009176,-8.0091752 z" />
    </clipPath>
  </defs>
  <g
     id="layer1">
    <path
       id="path846"
       style="fill:#000000;fill-opacity:1;stroke-width:0.926042;stroke-linecap:round;stroke-dasharray:3.70417, 3.70417"
       d="M 68.260431,39.44854 A 31.600138,31.3936 0 0 1 36.660294,70.84214 31.600138,31.3936 0 0 1 5.0601559,39.44854 31.600138,31.3936 0 0 1 36.660294,8.0549393 31.600138,31.3936 0 0 1 68.260431,39.44854 Z"
       clip-path="url(#clipPath1549)"
       transform="translate(-17.555633,8.1582059)" />
  </g>
</svg>

Maybe i could tweak SVG manually somehow to force it working ?

@softlion
Copy link
Owner

softlion commented Apr 22, 2022 via email

@b2yq
Copy link
Author

b2yq commented Jul 15, 2022

i needed clipping for making inner-shadow, but your advice with saving svg as optimized did the trick, 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