Skip to content

Commit

Permalink
fixed 100 percent
Browse files Browse the repository at this point in the history
Patric Gutersohn committed Apr 9, 2020

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
1 parent 59ee683 commit f63d92d
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/circliful.js
4 changes: 2 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
<div id="circle3" class="circle-default-style"></div>
<div id="circle4"
class="circle-default-style"
data-percent="90"
data-percent="100"
data-no-percentage-sign="true"
data-animation="false"
data-stroke-linecap="round">
@@ -99,7 +99,7 @@
});

circliful.newCircle({
percent: 75,
percent: 100,
id: 'circle5',
type: 'plain',
animation: false,
7 changes: 6 additions & 1 deletion src/helper/svg-tags-helper.ts
Original file line number Diff line number Diff line change
@@ -61,10 +61,15 @@ class SvgTagsHelper {
const start = SvgTagsHelper.polarToCartesian(x, y, radius, endAngle);
const end = SvgTagsHelper.polarToCartesian(x, y, radius, startAngle);
const largeArcFlag = endAngle - startAngle <= 180 ? "0" : "1";
let closePath = false;

if (endAngle === 360 && end.x > start.x) {
closePath = true;
start.x = start.x - 0.001;
}
return [
"M", start.x, start.y,
"A", radius, radius, 0, largeArcFlag, 0, end.x, end.y,
"A", radius, radius, 0, largeArcFlag, 0, end.x, end.y, (closePath ? 'Z' : '')
].join(" ");
}
}

0 comments on commit f63d92d

Please sign in to comment.