示例
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>
元素
你可以在下面部分描述的 SVG 元素中使用此屬性。
<pattern>
對於 <pattern>,patternTransform 定義了一系列應用於圖案圖塊的變換定義。
注意: 從 SVG2 開始,也允許使用 CSS 的 transform 屬性。然而,目前的實現狀態並不太好。為了向後相容,強烈建議繼續使用 patternTransform 屬性。
| 值 | <transform-list> |
|---|---|
| 預設值 | 恆等變換 |
| 可動畫的 | 是 |
變換函式
要了解更多關於變換函式定義的資訊,請參閱 transform 屬性定義。
規範
| 規範 |
|---|
| Scalable Vector Graphics (SVG) 2 # PatternElementPatternTransformAttribute |
瀏覽器相容性
載入中…