fix(ui): make compare image scale with first image when using contain fit

This commit is contained in:
psychedelicious 2024-06-01 11:07:51 +10:00
parent 745140fa6b
commit 0f0a6852f1

View File

@ -168,8 +168,8 @@ export const ImageComparisonSlider = memo(({ firstImage, secondImage }: Props) =
<Image
src={secondImage.image_url}
fallbackSrc={secondImage.thumbnail_url}
w={sliderFit === 'fill' ? fittedSize.width : secondImage.width}
h={sliderFit === 'fill' ? fittedSize.height : secondImage.height}
w={sliderFit === 'fill' ? fittedSize.width : (fittedSize.width * secondImage.width) / firstImage.width}
h={sliderFit === 'fill' ? fittedSize.height : (fittedSize.height * secondImage.height) / firstImage.height}
maxW={fittedSize.width}
maxH={fittedSize.height}
objectFit={sliderFit}