File tree Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " rc-tween-one" ,
3
- "version" : " 2.3.2 " ,
3
+ "version" : " 2.3.3 " ,
4
4
"description" : " tween-one anim component for react" ,
5
5
"keywords" : [
6
6
" react" ,
Original file line number Diff line number Diff line change @@ -450,16 +450,16 @@ p.resetDefaultStyle = function () {
450
450
} ) ;
451
451
} ;
452
452
453
- p . reStart = function ( style ) {
453
+ p . reStart = function ( style , preStyle , isTween ) {
454
454
this . start = { } ;
455
- this . target . style . cssText = getDefaultStyle ( this . target . style . cssText ,
456
- this . startDefaultData . style ,
457
- this . data ) ;
455
+ this . tween = { } ;
458
456
Object . keys ( style || { } ) . forEach ( key => {
459
- this . target . style [ key ] = stylesToCss ( key , style [ key ] ) ;
457
+ if ( isTween || ! preStyle || style [ key ] !== preStyle [ key ] ) {
458
+ this . target . style [ key ] = stylesToCss ( key , style [ key ] ) ;
459
+ }
460
460
} ) ;
461
461
this . setAttrIsStyle ( ) ;
462
- this . resetDefaultStyle ( ) ;
462
+ this . computedStyle = null ;
463
463
} ;
464
464
465
465
p . onChange = noop ;
Original file line number Diff line number Diff line change @@ -117,7 +117,8 @@ class TweenOne extends Component {
117
117
if ( ! styleEqual ) {
118
118
// 在动画时更改了 style, 作为更改开始数值。
119
119
if ( this . tween ) {
120
- this . tween . reStart ( nextProps . style ) ;
120
+ this . tween . reStart ( nextProps . style , this . props . style ,
121
+ this . tween . progressTime < this . tween . totalTime ) ;
121
122
if ( this . paused ) {
122
123
this . raf ( ) ;
123
124
}
You can’t perform that action at this time.
0 commit comments