SVG模式:使用ViewBox的相对坐标.Firefox中的问题



我有一个模式的问题,该模式必须在我的SVG中具有相对坐标。首先,我使用了patterncontentunits =" ObjectBoundingBox",它们似乎可以很好地工作所有现代浏览器。但是,我希望使用Batik Rasterizer允许用户将SVG转换为PDF和/或PNG和PNG和Batik Rasterizer似乎不支持patterncontentunits ="用于SVG的ObjectBoundingBox for SVG转换。

<pattern id="Pattern2" x="0" y="0" width="1" height="1" patternContentUnits="objectBoundingBox">
<rect x="0.1" y="0" width="0.33" height="1" style="fill:rgb(39,80,215)"/>
<rect x="0.49" y="0" width="0.47" height="1" style="fill:rgb(11,198,221)"/>
</pattern>

作为替代方案,我找到了一个Internet帖子,其中他们使用了ViewBox =" 0 0 1 1" PreserveSpectratio =" NONE",而不是PatternContentunits =" ObjectBoundingBox"。该解决方案在Chrome,IE9以及Batik Rasterizer(!)中也很好地工作。但是,它是在Firefox中工作的(14)。

我在此处在网上放了一个小例子:http://mgcv.cmbi.ru.nl/example.svg
(Chrome,IE9和Batik Rasterizer中的第一部作品,但在FF14中不进行。第二件作品在Chrome,IE9和FF14中效果很好,但在Batik Rasterizer(PDF Conversion)中效果不佳)

有人有建议吗?在我看来,应该可以在Firefox中使用Viewbox解决方案?

应将其固定在当前在beta中的Firefox 17中。有关更多详细信息,请参见Bug 773467和Bug 773595。

最新更新