Skip to content

Commit b31c041

Browse files
committed
Reset anchor point and position of the content view layer in case UIKit resets one of them independently.
1 parent a43dac3 commit b31c041

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Sources/AnimatedCollectionViewLayout/Animators/CubeAttributesAnimator.swift

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public struct CubeAttributesAnimator: LayoutAttributesAnimator {
2626
let position = attributes.middleOffset
2727
if abs(position) >= 1 {
2828
attributes.contentView?.layer.transform = CATransform3DIdentity
29+
attributes.contentView?.keepCenterAndApplyAnchorPoint(CGPoint(x: 0.5, y: 0.5))
2930
} else if attributes.scrollDirection == .horizontal {
3031
let rotateAngle = totalAngle * position
3132
var transform = CATransform3DIdentity

0 commit comments

Comments
 (0)