 
 		let visibleIndexes: CountableRange<Int>
 
-		if viewControllers.isEmpty || bounds.isEmpty {
+		if viewControllers.isEmpty || scrollViewSize.isEmpty {
 			visibleIndexes = 0 ..< 0
 		}
 		else {
-			let floatingIndex = contentOffset.left / bounds.width
-			visibleIndexes = Int(floatingIndex.rounded(.down)).coerced(in: 0 ... (viewControllers.count - 1)) ..< (Int(floatingIndex.rounded(.up)).coerced(in: 0 ... (viewControllers.count - 1)) + 1)
+			let floatingIndex = contentOffset.left / scrollViewSize.width
+			visibleIndexes = Int(floatingIndex.rounded(.down)).coerced(in: 0 ... (viewControllers.count - 1))
+				..< (Int(floatingIndex.rounded(.up)).coerced(in: 0 ... (viewControllers.count - 1)) + 1)
 		}
 
 		for subview in childContainer.subviews {


	fileprivate var ignoresScrollViewDidScroll = 0
	fileprivate var isSettingPrimaryViewControllerInternally = false
	fileprivate var lastLayoutedSize = CGSize.zero
	fileprivate var lastLayoutedSizeForChildren = CGSize.zero
	fileprivate var reusableChildView: ChildView?
	fileprivate var scrollCompletion: ScrollCompletion?
	fileprivate var viewControllersNotYetMovedToParentViewController = [UIViewController]()

			return
		}

		let containerSize = scrollView.bounds.size

		var childViewFrame = CGRect()
		childViewFrame.left = CGFloat(childView.index) * containerSize.width
		childViewFrame.size = containerSize
		childView.frame = childViewFrame
	}

