From 9e668277f76e78662db0a0ba80fcd2e9d50005af Mon Sep 17 00:00:00 2001 From: pavelbabenko Date: Tue, 30 Jul 2024 13:15:27 +0300 Subject: [PATCH] Fix RTL --- src/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 28b4c98..fe9e317 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -836,7 +836,7 @@ const ResizableImage = React.memo( zIndex: index === currentIndex.value ? 1 : 0, transform: [ { - translateX: (width + emptySpaceWidth) * index, + translateX: getPosition(rtl ? index : -index), }, ], }; @@ -859,8 +859,8 @@ const ResizableImage = React.memo( translateX: offset.x.value + translation.x.value - - (isNextForLast ? getPosition(length) : 0) + - (isPrevForFirst ? getPosition(length) : 0), + (isNextForLast ? getPosition(rtl ? -length : length) : 0) + + (isPrevForFirst ? getPosition(rtl ? -length : length) : 0), }, { translateY: offset.y.value + translation.y.value }, { scale: scale.value },