     }
     
     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){

    
    func transformVisibleItems(){
        let midItem = max(Int(floor((scrollView.contentOffset.x + itemSize.width / 2) / itemSize.width)), 0)
        let affectedRange = max(midItem - 1, 0)..<min(midItem + 2, previewViews.count)
        
        affectedRange.forEach(applyTransform)
        previewViews.indices.forEach(applyContainerTransform)

    override open func viewDidLayoutSubviews() {
        super.viewDidLayoutSubviews()
        scrollView.frame = view.bounds
        scrollView.contentSize = contentSize
        scrollView.setContentOffset(contentOffset(for: viewControllerIndex), animated: false)
        
        previewViews.enumerated().forEach { (index, view) in
            let attributes = layoutAttributes(forIndex: index)
            view.layer.transform = CATransform3DIdentity
            view.frame = attributes.frame
            view.center = attributes.frame.center
        }
        
        containerViews.enumerated().forEach { (index, view) in
            let attributes = containerLayoutAttributes(forIndex: index)
            view.layer.transform = CATransform3DIdentity
            view.frame = attributes.frame
            view.center = attributes.frame.center
        }
        
        previewViews.indices.forEach(applyTransform)
        containerViews.indices.forEach(applyContainerTransform)
    }
    
    var timer: Timer?
