我有這樣的代碼:
<svg width="100" height="100">
<circle cx="50" cy="50" r="50" stroke="green" stroke='1' stroke-width="1" fill='yellow'/>
</svg>
結果我被切斷了圈子。

有什么方法可以在不減小圓半徑的情況下繪制整圓?
uj5u.com熱心網友回復:
筆劃寬度在筆劃線的內部和外部。在示例中,我將寬度為 1 的描邊的半徑更改為 49.5。在第二個示例中,我使描邊更粗(10)和半透明,以便您可以看到描邊覆寫了內部填充的一部分和外面。
<svg width="100" height="100">
<circle cx="50" cy="50" r="49.5" stroke="green" stroke-width="1" fill='yellow'/>
</svg>
<svg width="100" height="100">
<circle cx="50" cy="50" r="45" stroke="darkblue" stroke-opacity=".5" stroke-width="10" fill='yellow'/>
</svg>
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/480696.html
標籤:svg
