Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0bc589d

Browse files
Preet ShihnPreet Shihn
authored andcommitted
.
1 parent 0a1de08 commit 0bc589d

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

dist/lumin.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ class Highlighter {
102102

103103
start(duration) {
104104
this._cancelPending();
105-
delete this._prevValue;
106105
if (!this._overlay) {
107106
this._reset();
108107
}
@@ -154,16 +153,12 @@ class Highlighter {
154153
}
155154

156155
set progress(value) {
156+
this.clear();
157157
if (!this._overlay) {
158158
this._reset();
159159
}
160160
value = Math.min(100, Math.max(0, value));
161161
const progressCharCount = Math.round(this._charCount * value / 100);
162-
const reset = (!this._prevValue) || (this._prevValue > progressCharCount);
163-
this._prevValue = progressCharCount;
164-
if (reset) {
165-
this.clear();
166-
}
167162
let count = 0;
168163
for (const d of this._map) {
169164
let diff = progressCharCount - count;

0 commit comments

Comments
 (0)