patternTransform
示例
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>
圖案
對於 <pattern>,patternTransform 定義應用於圖案平鋪的一系列變換定義。
注意:從 SVG2 開始,也可以使用 CSS 的 transform 屬性。但是,當前的實現狀態不是很好。出於向後相容性的原因,強烈建議繼續使用 patternTransform 屬性。
| 值 | <transform-list> |
|---|---|
| 預設值 | 恆等變換 |
| 可動畫 | 是 |
變換函式
要詳細瞭解變換函式的定義,請參閱 transform 屬性定義。
規範
| 規範 |
|---|
| 可縮放向量圖形 (SVG) 2 # PatternElementPatternTransformAttribute |
瀏覽器相容性
BCD 表格僅在瀏覽器中載入