SVGPatternElement: patternTransform 屬性
SVGPatternElement 介面的只讀屬性 patternTransform 反映了給定 <pattern> 元素的 patternTransform 屬性。此屬性儲存應用於圖案本身的變換,允許進行 translate、rotate、scale 和 skew 等操作。
值
一個 SVGAnimatedTransformList 物件。
示例
在此示例中,圖案在 X 軸上旋轉 20 度,傾斜 30 度,並且在水平方向上縮放因子為 1,在垂直方向上縮放因子為 0.5。
html
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
<!-- Apply a transform on the tile -->
<pattern
id="p1"
width=".25"
height=".25"
patternTransform="rotate(20)
skewX(30)
scale(1 0.5)">
<circle cx="10" cy="10" r="10" />
</pattern>
<!-- Apply the transformed pattern tile -->
<rect x="10" y="10" width="80" height="80" fill="url(#p1)" />
</svg>
規範
| 規範 |
|---|
| Scalable Vector Graphics (SVG) 2 # __svg__SVGPatternElement__patternTransform |
瀏覽器相容性
載入中…