     }
     
     func apply(attributes: LayoutAttributes, to view: UIView){
-        if view.frame != attributes.frame {
-            view.frame = attributes.frame
-        }
         view.alpha = attributes.alpha
         view.layer.transform = attributes.transform3D
         view.isHidden = attributes.isHidden
     }
     
     func applyTransform(_ index: Int){
-        apply(attributes: self.layoutAttributes(forIndex: index), to: previewViews[index])
+        apply(attributes: layoutAttributes(forIndex: index), to: previewViews[index])
     }
     
     func applyContainerTransform(_ index: Int){

    override open func viewDidLayoutSubviews() {
        super.viewDidLayoutSubviews()
        scrollView.frame = view.bounds
        scrollView.contentSize = CGSize(width: (itemSize.width) * CGFloat(itemCount + 1), height: view.bounds.height)
        previewViews.indices.forEach(applyTransform)
        previewViews.indices.forEach(applyContainerTransform)
        scrollView.contentOffset = CGPoint(x: CGFloat(viewControllerIndex) * itemSize.width, y: 0)
        state = .expanded
    }
    
    var timer: Timer?

        let maxDistance = view.bounds.width / 2
        let size = itemSize
        let frame = CGRect(
            origin: CGPoint(x: itemSize.width / 2 + itemSize.width * CGFloat(index), y: view.bounds.midY - size.height / 2),
            size: size
        )
        
