我想缩放嵌入在svg中的弧线.在应用比例变换时,它会向0,0缩放.相反,我希望它可以从它自己的缩放中心缩放.
这是代码
<g>
<path d="M 300 100 a 200 200 0 1 0 0.00001 0" fill="#7EEC4A" stroke="rgb(208,231,235)" linejoin="round" stroke-width="1" fill-opacity="0.9" stroke-opacity="0.2">
</path>
<animateTransform attributeType="xml"
attributeName="transform"
type="scale"
from="0"
to="1"
dur="0.5s" fill="freeze" />
</g>
Run Code Online (Sandbox Code Playgroud)
mbo*_*nin 12
使用<circle>元素并设置"r"属性的动画:
<g>
<circle cx="200" cy="200" r="200" fill="#7EEC4A" stroke="rgb(208,231,235)" linejoin="round" stroke-width="1" fill-opacity="0.9" stroke-opacity="0.2">
<animate attributeType="xml" attributeName="r" from="0" to="200" dur="5s" repeatCount="indefinite" />
</circle>
</g>
Run Code Online (Sandbox Code Playgroud)
不完全令人满意,因为我无法保持原来的形状不变,但所需的效果似乎还可以:
<g transform="translate(300,250)">
<g>
<path d="M 0 -150 a 200 200 0 1 0 0.00001 0" fill="#7EEC4A"
stroke="rgb(208,231,235)" linejoin="round" stroke-width="1" fill-opacity="0.9"
stroke-opacity="0.2">
</path>
<animateTransform attributeType="xml"
attributeName="transform"
type="scale"
from="0"
to="1"
dur="0.5s" fill="freeze" />
</g>
</g>
Run Code Online (Sandbox Code Playgroud)
你可以尝试这个小提琴
| 归档时间: |
|
| 查看次数: |
13318 次 |
| 最近记录: |