Skip to content

Commit bdab573

Browse files
committed
fix #41
1 parent 480a3fe commit bdab573

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rc-tween-one",
3-
"version": "2.2.6",
3+
"version": "2.2.7",
44
"description": "tween-one anim component for react",
55
"keywords": [
66
"react",

src/Tween.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,8 @@ p.render = function () {
310310
!(progressTime > duration && item.mode === 'onComplete') &&
311311
this.start[i]) {
312312
const updateAnim = this.updateAnim === 'update';
313-
progressTime = (progressTime < this.perFrame - this.accuracy) && !reverse ? 0 : progressTime;
313+
progressTime = (progressTime < this.perFrame - this.accuracy) && !reverse
314+
&& item.duration >= this.perFrame ? 0 : progressTime;
314315
if (((progressTime >= duration - this.accuracy && !reverse) || (reverse && progressTime <= 0))
315316
&& repeatNum >= item.repeat) {
316317
// onReveresComplete 和 onComplete 统一用 onComplete;

src/TweenOne.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,8 @@ class TweenOne extends Component {
228228
let repeatNum = Math.floor(moment / this.tween.totalTime) || 0;
229229
repeatNum = repeatNum > repeat ? repeat : repeatNum;
230230
let tweenMoment = moment - this.tween.totalTime * repeatNum;
231-
tweenMoment = tweenMoment < perFrame && !this.reverse ? 0 : tweenMoment;
231+
tweenMoment = tweenMoment < perFrame && !this.reverse &&
232+
totalTime >= perFrame ? 0 : tweenMoment;
232233
if (repeat && moment && moment - this.tween.totalTime * repeatNum < perFrame) {
233234
// 在重置样式之前补 complete;
234235
this.tween.frame(this.tween.totalTime * repeatNum);

0 commit comments

Comments
 (0)