Various fixes

This commit is contained in:
Ilya Laktyushin 2022-05-25 17:07:19 +04:00
parent a01fe7a603
commit f4d9c0e2f7

View File

@ -359,17 +359,18 @@ private final class DemoPagerComponent: Component {
self.scrollView.addSubview(itemView)
}
let itemFrame = CGRect(origin: CGPoint(x: availableSize.width * CGFloat(i), y: 0.0), size: availableSize)
let isDisplaying = itemFrame.intersects(self.scrollView.bounds)
let isDisplaying = itemView.frame.intersects(self.scrollView.bounds)
let environment = DemoPageEnvironment(isDisplaying: isDisplaying)
let itemSize = itemView.update(
let _ = itemView.update(
transition: itemTransition,
component: item.content.component,
environment: { environment },
containerSize: availableSize
)
itemView.frame = CGRect(origin: CGPoint(x: availableSize.width * CGFloat(i), y: 0.0), size: itemSize)
itemView.frame = itemFrame
i += 1
}