Skip to content

Commit

Permalink
FIX: 修复进度点没有显示完整的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaszhu committed Jun 7, 2020
1 parent 57535d6 commit af4f20a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions dist/progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,12 @@ var MpProgress = /*#__PURE__*/function () {
if (this._options.dotStyle.length > 0) {
var circleR = this._options.dotStyle[0].r;

if (circleR > maxBarWidth) {
var diff = circleR - maxBarWidth + (this._options.dotStyle[0].shadow ? circleR / 2 : 0);
_r -= diff;
if (circleR * 2 > maxBarWidth) {
var shadowDiff = this._options.dotStyle[0].shadow ? circleR / 4 : 0;
_r -= circleR - maxBarWidth + shadowDiff;

if (this._percent !== 100) {
originY -= diff;
originY -= circleR + shadowDiff;
}
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion dist/progress.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,11 @@ class MpProgress {
// 考虑剔除进度点的宽度差以及进度点阴影的宽度查
if (this._options.dotStyle.length > 0) {
const circleR = this._options.dotStyle[0].r;
if (circleR > maxBarWidth) {
const diff = circleR - maxBarWidth + (this._options.dotStyle[0].shadow ? circleR / 2 : 0);
_r -= diff;
if (circleR*2 > maxBarWidth) {
const shadowDiff = this._options.dotStyle[0].shadow ? circleR / 4 : 0;
_r -= circleR - maxBarWidth + shadowDiff;
if (this._percent !== 100) {
originY -= diff;
originY -= circleR + shadowDiff;
}
}
} else {
Expand Down

0 comments on commit af4f20a

Please sign in to comment.