From 1249e9d1e5b88ecbd4169778843e68b4e8b33a7c Mon Sep 17 00:00:00 2001 From: Mitsu Takeuchi Date: Mon, 15 Jan 2024 11:47:04 +0900 Subject: [PATCH] fix: round "translate" destination to prevent problems around images --- src/js/components/Move/Move.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/components/Move/Move.ts b/src/js/components/Move/Move.ts index d0c25802..7cfc0882 100644 --- a/src/js/components/Move/Move.ts +++ b/src/js/components/Move/Move.ts @@ -122,7 +122,7 @@ export function Move( Splide: Splide, Components: Components, options: Options ) function translate( position: number, preventLoop?: boolean ): void { if ( ! Splide.is( FADE ) ) { const destination = preventLoop ? position : loop( position ); - style( list, 'transform', `translate${ resolve( 'X' ) }(${ destination }px)` ); + style( list, 'transform', `translate${ resolve( 'X' ) }(${ Math.round( destination ) }px)` ); position !== destination && emit( EVENT_SHIFTED ); } }