diff --git a/src/circle/index.js b/src/circle/index.js index a61aa7e56..8c470a112 100644 --- a/src/circle/index.js +++ b/src/circle/index.js @@ -12,9 +12,9 @@ function format(rate) { return Math.min(Math.max(rate, 0), 100); } -function getPath(clockwise) { +function getPath(clockwise, viewBoxSize) { const sweepFlag = clockwise ? 1 : 0; - return `M 530 530 m 0, -500 a 500, 500 0 1, ${sweepFlag} 0, 1000 a 500, 500 0 1, ${sweepFlag} 0, -1000`; + return `M ${viewBoxSize / 2} ${viewBoxSize / 2} m 0, -500 a 500, 500 0 1, ${sweepFlag} 0, 1000 a 500, 500 0 1, ${sweepFlag} 0, -1000`; } export default createComponent({ @@ -72,7 +72,11 @@ export default createComponent({ }, path() { - return getPath(this.clockwise); + return getPath(this.clockwise, this.viewBoxSize); + }, + + viewBoxSize() { + return 1000 + this.strokeWidth; }, layerStyle() { @@ -154,7 +158,7 @@ export default createComponent({ render() { return (