add transform origin to animation
This commit is contained in:
committed by
Eric Bailey
parent
af70a8a9e0
commit
ca4e7f9cc0
@@ -294,7 +294,9 @@ function Bubble({
|
|||||||
left: coords.left,
|
left: coords.left,
|
||||||
},
|
},
|
||||||
]}>
|
]}>
|
||||||
<Animated.View entering={ZoomIn.easing(Easing.out(Easing.exp))}>
|
<Animated.View
|
||||||
|
entering={ZoomIn.easing(Easing.out(Easing.exp))}
|
||||||
|
style={{transformOrigin: oppposite(position)}}>
|
||||||
<View
|
<View
|
||||||
style={[
|
style={[
|
||||||
a.absolute,
|
a.absolute,
|
||||||
@@ -341,3 +343,14 @@ function Bubble({
|
|||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function oppposite(position: 'top' | 'bottom') {
|
||||||
|
switch (position) {
|
||||||
|
case 'top':
|
||||||
|
return 'center bottom'
|
||||||
|
case 'bottom':
|
||||||
|
return 'center top'
|
||||||
|
default:
|
||||||
|
return 'center'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user