Fix last frame flash

This commit is contained in:
Dan Abramov
2024-11-08 23:51:57 +00:00
parent e7f6bca63d
commit eab9bb82af
4 changed files with 20 additions and 2 deletions
@@ -58,6 +58,7 @@ type Props = {
cropFrameTransform: Transform
cropContentTransform: Transform
isResting: boolean
isHidden: boolean
}>
>
}
@@ -310,7 +311,7 @@ const ImageItem = ({
)
const containerStyle = useAnimatedStyle(() => {
const {scaleAndMoveTransform} = transforms.value
const {scaleAndMoveTransform, isHidden} = transforms.value
// Apply the active adjustments on top of the committed transform before the gestures.
// This is matrix multiplication, so operations are applied in the reverse order.
let t = createTransform()
@@ -325,6 +326,7 @@ const ImageItem = ({
]
const screenSize = measureSafeArea()
return {
opacity: isHidden ? 0 : 1,
transform: scaleAndMoveTransform.concat(manipulationTransform),
width: screenSize.width,
maxHeight: screenSize.height,