如何使用Chrome中的<pattern>可靠地填充SVG&amp; Safari浏览器</图案>

时间:2015-01-27 19:15:52

标签: css google-chrome design-patterns svg safari

Safari 7.0&amp; 8.0&amp; Chrome 40.X,当设置负标度时,不会显示填充的SVG。

研究表明,这可能是由于最近的Chrome问题: https://code.google.com/p/chromium/issues/detail?id=447707

经过几个小时的研究后,我无法找到Safari 8.0或7.0的任何已知问题。请注意,此问题已在Safari 8.1.2中修复。

有谁知道如何在此SVG for Chrome 40.X&amp;的背景下正确显示图像。 Safari 7.0&amp; 8.0?我已经确认删除负面比例确实解决了这个问题,但我非常希望不必删除比例。还有其他想法吗?

以下是SVG的代码:

<svg style="stroke-width: 20px; stroke-dasharray: 50, 50; stroke-opacity: 1; stroke: rgb(172, 245, 82); transition: stroke 500ms ease 500ms; stroke-linecap: round; stroke-linejoin: round;" fill="url(#a_fabricPattern)" class="svg-container svgStroke" version="1.1" id="a_svgContainer" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="100%" height="100%" viewBox="0 0 1000 1020" xml:space="preserve">
    <defs>
        <pattern patternUnits="userSpaceOnUse" id="a_fabricPattern" width="5730" height="4650" x="0" y="0">
            <image x="0" y="0" id="fabricBgID" width="5730" height="4650" xlink:href="http://blob.apliiq.com/sitestorage/cropped-fabrics/805_573_465.jpg"></image>
        </pattern>
    </defs>
    <g id="svgGtag">
        <g transform="translate(0,1020) scale(0.130000,-0.130000)">
            <path d="M1222 6277 l-262 -262 0 -2240 0 -2240 218 -218 217 -217 1171 0
            1171 0 246 254 247 254 0 2210 0 2210 -257 256 -258 256 -1115 0 -1115 0 -263
            -263z m1948 -2477 l0 -1760 -575 0 -575 0 0 1760 0 1760 575 0 575 0 0 -1760z"></path>
            <path d="M5104 6407 c-77 -73 -205 -193 -285 -267 -79 -74 -197 -184 -262
            -246 l-117 -111 2 -334 3 -334 188 -5 187 -5 3 -1522 c2 -1261 0 -1524 -11
            -1528 -8 -3 -102 -5 -209 -5 l-195 0 6 -31 c3 -17 6 -231 6 -475 l0 -444 945
            0 945 0 0 475 0 475 -197 2 -198 3 -3 2243 -2 2242 -333 0 -332 -1 -141 -132z"></path>
        </g>
    </g>
</svg>

0 个答案:

没有答案