File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -482,6 +482,9 @@ export class Carousel extends Component<CarouselOptions> {
482482 this . el . classList . remove ( 'scrolling' ) ;
483483 } , this . options . duration ) ;
484484
485+ // Save last center before updating the center for onCycleTo callback
486+ const lastCenter = this . center ;
487+
485488 // Start actual scroll
486489 this . offset = typeof x === 'number' ? x : this . offset ;
487490 this . center = Math . floor ( ( this . offset + this . dim / 2 ) / this . dim ) ;
@@ -496,7 +499,6 @@ export class Carousel extends Component<CarouselOptions> {
496499 zTranslation : number ,
497500 tweenedOpacity : number ,
498501 centerTweenedOpacity : number ;
499- const lastCenter = this . center ;
500502 const numVisibleOffset = 1 / this . options . numVisible ;
501503
502504 // delta = this.offset - this.center * this.dim;
You can’t perform that action at this time.
0 commit comments