Quantcast
Viewing all articles
Browse latest Browse all 61891

position of Svg Pattern

Hi all,

 

I am working on svg things, and have a little question about Illustrator concerning an incorrect position of a pattern.

 

Let's say I have this svg :

 

 

<?xml version="1.0"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="400" version="1.1" width="600" style="overflow-x: hidden; overflow-y: hidden; position: relative; "><defs>          <pattern id="aLinePattern" x="0" y="0" patternUnits="userSpaceOnUse" height="20px" width="300px" >          <g>                    <rect fill="none" width="300" height="20"/>                    <rect fill="#B64F30" width="300" height="9"/>                    <rect y="19" fill="#B64F30" width="300" height="1"/>          </g>          </pattern></defs>          <g>                    <g>                              <g transform="translate(0 0)">                                        <path style="stroke-miterlimit: 10; " fill="url(#aLinePattern)" stroke="#1c1c12" d="M145.984,41.073C145.984,47.35,140.714,52.441,134.215,52.441H13.187C6.686999999999999,52.441,1.4169999999999998,47.35,1.4169999999999998,41.073V12.786C1.4169999999999998,6.508,6.686999999999999,1.4179999999999993,13.187,1.4179999999999993H134.216C140.715,1.4179999999999993,145.985,6.507999999999999,145.985,12.786V41.073Z" stroke-width="2.8346666666666667" stroke-miterlimit="10" data-svg="path" data-svg-group="Layer_1" id="main"/>                              </g>                    </g>          </g></svg>

 

 

This svg is very basic, it draws a box, creates a pattern (2 red lines, and a transparent space between them).

 

If I open the svg on a browser, it will show correctly and the patterns are placed at their exact position. When I open it under Illustrator, the patterns are lightly vertically shifted. This pattern is not big, the shift is of a few points, but for bigger patterns, the shift is way more important !

 

Would someone know how why this shift appears, and eventually how Illustrator calculates this shift (so I can compensate programaticaly) ?

 

I thank you in advance and wish you a good day.

 

Jim


Viewing all articles
Browse latest Browse all 61891

Trending Articles