Skip to content

Commit 4bf31e9

Browse files
committed
feat: add fill circle radius calculations
1 parent f1b87c5 commit 4bf31e9

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

src/App.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
<input type="checkbox" v-model="circles[3].loading" />
3939
</div>-->
4040
<div style="border: 1px solid red; display: inline-block">
41-
<ve-progress :size="600" color-fill="red" :progress="progress"> </ve-progress>
41+
<ve-progress :size="600" line-position="out 80" :color-fill="emptyColorFill" :progress="progress">
42+
</ve-progress>
4243
</div>
4344
<ve-progress
4445
dot="20 green"

src/components/Circle/Circle.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<circle
3232
class="ep-circle--progress__fill"
3333
:class="animationClass"
34-
:r="radius"
34+
:r="fillRadius"
3535
:cx="position"
3636
:cy="position"
3737
:fill="computedColorFill"

src/components/Circle/circleMixin.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ export default {
3232
radius() {
3333
return radius(this.options);
3434
},
35+
fillRadius() {
36+
const { offset, position } = this.options.linePosition;
37+
if (position === "center") {
38+
return this.radius;
39+
}
40+
return position === "out" ? this.radius - offset - this.thickness / 2 : this.radius + this.thickness / 2;
41+
},
3542
emptyRadius() {
3643
return emptyRadius(this.options);
3744
},

0 commit comments

Comments
 (0)