Fix tall image final state
The initial animation frame is still off on both platforms.
This commit is contained in:
@@ -325,10 +325,13 @@ const ImageItem = ({
|
|||||||
{translateY: translateY},
|
{translateY: translateY},
|
||||||
{scale},
|
{scale},
|
||||||
]
|
]
|
||||||
|
const screenSize = measureSafeArea()
|
||||||
return {
|
return {
|
||||||
width: '100%',
|
|
||||||
aspectRatio: imageAspect,
|
|
||||||
transform: scaleAndMoveTransform.concat(manipulationTransform),
|
transform: scaleAndMoveTransform.concat(manipulationTransform),
|
||||||
|
width: screenSize.width,
|
||||||
|
maxHeight: screenSize.height,
|
||||||
|
aspectRatio: imageAspect,
|
||||||
|
alignSelf: 'center',
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -640,8 +640,16 @@ function interpolateTransform(
|
|||||||
uncroppedInitialWidth = thumbnailDims.width
|
uncroppedInitialWidth = thumbnailDims.width
|
||||||
uncroppedInitialHeight = thumbnailDims.width / imageAspect
|
uncroppedInitialHeight = thumbnailDims.width / imageAspect
|
||||||
}
|
}
|
||||||
const finalWidth = safeArea.width
|
const safeAreaAspect = safeArea.width / safeArea.height
|
||||||
const finalHeight = safeArea.width / imageAspect
|
let finalWidth
|
||||||
|
let finalHeight
|
||||||
|
if (safeAreaAspect > imageAspect) {
|
||||||
|
finalWidth = safeArea.height * imageAspect
|
||||||
|
finalHeight = safeArea.height
|
||||||
|
} else {
|
||||||
|
finalWidth = safeArea.width
|
||||||
|
finalHeight = safeArea.width / imageAspect
|
||||||
|
}
|
||||||
const initialScale = Math.min(
|
const initialScale = Math.min(
|
||||||
uncroppedInitialWidth / finalWidth,
|
uncroppedInitialWidth / finalWidth,
|
||||||
uncroppedInitialHeight / finalHeight,
|
uncroppedInitialHeight / finalHeight,
|
||||||
|
|||||||
Reference in New Issue
Block a user