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

convertTransform rotates pattern when spliting patternTransform="matrix()" in "transform="rotate() scale()" #986

Closed
JoKalliauer opened this issue Jun 16, 2018 · 0 comments

Comments

@JoKalliauer
Copy link

JoKalliauer commented Jun 16, 2018

Prozessing File:Standard_Time_Zones_of_the_World_(August_2013).svg with

$ svgo -i Standard_Time_Zones_of_the_World_(August_2013).svg -o output.svg

leads to a rotation of the patterns of 90° or a mirrowing.

patternTransform="matrix(.647 -.647 -.6443 -.6443 758.54 469.94)" is changed to patternTransform="rotate(45 946.543 -680.665) scale(.915 -.9112)"


input.svg.txt

<svg height="713.54pt" viewBox="0 0 1337.6 713.54" width="1337.6pt" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
 <defs>
  <clipPath id="a">
   <path d="M0 0h3v6H0z"/>
  </clipPath>
  <g id="b" clip-path="url(#a)">
   <path d="M3 2.988H0V6h3z" fill="#99b0b0"/>
   <path d="M3 0H0v3.012h3z" fill="#c7cf8a"/>
  </g>
  <clipPath id="c">
   <path d="M874 406h73v62h-73z"/>
  </clipPath>
  <clipPath id="d">
   <path d="M894.34 446.23l-1.04-.34-.003.492zm-17.793-39.035l.422-.293.848.59 2.464 2.809 2.606.625 1.344-.149 3.101-2.531 2.246-1.133 1.247 1.492-.614.754.64.621-1.16.778 2.18 2.004 1.074-.114.665 3.313 4.367 1.703 1.34 1.305 2.468 1.14 2.27.512 4.879-1.098 2.48-.281-.89.133 1.507.21-.46-2.242 2.457-.425 2.175-2.184 1.614-.61 2.449.106.777-.8 2.563.03.851 1.2 2.207.558.985.735 3.078.21 1.055.426.98 1.668 1.582.461 1.09 1.594 3.055.043.449 4.402-.801 3.375-1.25 1.184.691.871-.957.098-.425.515.113 2.325 1.375.422-1.324 1.492 1.015 3.91-.039 2.918 2.836.406.844 1.305-.145.871-3.46 4.082 3.87 5.305 3.254 1.469-.043 3.69 1.93.224-.562 2.293-3.043.476-1.692 1.094-.949 4.137-1.45.3-2.218-.581-.352-.688-4-.137-1.375.313-1.023-.649-5.496-.816-1.356-4.887-.84-.535-2.296-.074-1.739.664-.578.871-3.234 1.055-3.406-.871-.992-1.035-2.618-1.286-.957-1.297-3.96-1.316-1.708-3.508-.066-.941-1.09-.477.043-1.156-1.297-1.328-.773-1.55-1.918.66-2.219-1.56-.418.305.235 1.086-1.43.364-.652-1.149-1.223-1.02-.117-2.077h-1.14l.597-3.188-1.625-2.539-.254-.332-.746.063-2.41-1.817-1.489-.363-.566-2.41-.711-.227-1.3-1.48.667-1.387-.492-.61.207-.472.8.039.25-1.496.485-.649.93-.191-.578-1.426.074-1.004 1.156-.445-2.152-.07-.914-.844-.543.12-.543-1.905-.778-.422-.004-.926-.578-.168.137-.648-.414-.887.082-.711-.793-.676.05-1.125-1.41-.777.926-1.895-.515-.109-.13-1.898-1-2.426.762-.102.704-.18.152-1.12"/>
  </clipPath>
  <pattern id="e" height="6" patternTransform="matrix(.647 -.647 -.6443 -.6443 758.54 469.94)" patternUnits="userSpaceOnUse" width="3">
   <use xlink:href="#b"/>
  </pattern>
 </defs>
 <g clip-path="url(#c)" transform="translate(-87.22 -111.13)">
  <g clip-path="url(#d)">
   <path d="M874.93 467.52h71.492v-60.617H874.93z" fill="url(#e)"/>
  </g>
 </g>
</svg>

input


output.svg.txt

<svg height="951.387" viewBox="0 0 1337.6 713.54" width="1337.6pt" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
 <defs>
  <clipPath id="a">
   <path d="M0 0h3v6H0z"/>
  </clipPath>
  <g id="b" clip-path="url(#a)">
   <path d="M3 2.988H0V6h3z" fill="#99b0b0"/>
   <path d="M3 0H0v3.012h3z" fill="#c7cf8a"/>
  </g>
  <clipPath id="c">
   <path d="M874 406h73v62h-73z"/>
  </clipPath>
  <clipPath id="d">
   <path d="M894.34 446.23l-1.04-.34-.003.492zm-17.793-39.035l.422-.293.848.59 2.464 2.809 2.606.625 1.344-.149 3.101-2.531 2.246-1.133 1.247 1.492-.614.754.64.621-1.16.778 2.18 2.004 1.074-.114.665 3.313 4.367 1.703 1.34 1.305 2.468 1.14 2.27.512 4.879-1.098 2.48-.281-.89.133 1.507.21-.46-2.242 2.457-.425 2.175-2.184 1.614-.61 2.449.106.777-.8 2.563.03.851 1.2 2.207.558.985.735 3.078.21 1.055.426.98 1.668 1.582.461 1.09 1.594 3.055.043.449 4.402-.801 3.375-1.25 1.184.691.871-.957.098-.425.515.113 2.325 1.375.422-1.324 1.492 1.015 3.91-.039 2.918 2.836.406.844 1.305-.145.871-3.46 4.082 3.87 5.305 3.254 1.469-.043 3.69 1.93.224-.562 2.293-3.043.476-1.692 1.094-.949 4.137-1.45.3-2.218-.581-.352-.688-4-.137-1.375.313-1.023-.649-5.496-.816-1.356-4.887-.84-.535-2.296-.074-1.739.664-.578.871-3.234 1.055-3.406-.871-.992-1.035-2.618-1.286-.957-1.297-3.96-1.316-1.708-3.508-.066-.941-1.09-.477.043-1.156-1.297-1.328-.773-1.55-1.918.66-2.219-1.56-.418.305.235 1.086-1.43.364-.652-1.149-1.223-1.02-.117-2.077h-1.14l.597-3.188-1.625-2.539-.254-.332-.746.063-2.41-1.817-1.489-.363-.566-2.41-.711-.227-1.3-1.48.667-1.387-.492-.61.207-.472.8.039.25-1.496.485-.649.93-.191-.578-1.426.074-1.004 1.156-.445-2.152-.07-.914-.844-.543.12-.543-1.905-.778-.422-.004-.926-.578-.168.137-.648-.414-.887.082-.711-.793-.676.05-1.125-1.41-.777.926-1.895-.515-.109-.13-1.898-1-2.426.762-.102.704-.18.152-1.12"/>
  </clipPath>
  <pattern id="e" height="6" patternTransform="rotate(45 946.543 -680.665) scale(.915 -.9112)" patternUnits="userSpaceOnUse" width="3">
   <use xlink:href="#b"/>
  </pattern>
 </defs>
 <g clip-path="url(#c)" transform="translate(-87.22 -111.13)">
  <g clip-path="url(#d)">
   <path d="M874.93 467.52h71.492v-60.617H874.93z" fill="url(#e)"/>
  </g>
 </g>
</svg>

output

@GreLI GreLI closed this as completed in eeeb67d Sep 16, 2018
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