From 15cad0b3d1fbcda2b98f9a5fd18d0522d9ce83ec Mon Sep 17 00:00:00 2001 From: Luke Zhao Date: Tue, 7 May 2024 15:41:23 -0700 Subject: [PATCH] fix build --- Sources/UIComponent/Components/Layout/Other/DynamicPager.swift | 1 - Sources/UIComponent/Components/Layout/Other/DynamicStack.swift | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Sources/UIComponent/Components/Layout/Other/DynamicPager.swift b/Sources/UIComponent/Components/Layout/Other/DynamicPager.swift index efab1ac9..73cbb8aa 100644 --- a/Sources/UIComponent/Components/Layout/Other/DynamicPager.swift +++ b/Sources/UIComponent/Components/Layout/Other/DynamicPager.swift @@ -6,7 +6,6 @@ // import UIKit -import BaseToolbox /// A component that lays out its children horizontally in a paging fashion similar to an ``HPager``. /// However, instead of creating the child components all at once, it creates them on demand when it needs to render the specific page. diff --git a/Sources/UIComponent/Components/Layout/Other/DynamicStack.swift b/Sources/UIComponent/Components/Layout/Other/DynamicStack.swift index ed167205..f4c2e7fb 100644 --- a/Sources/UIComponent/Components/Layout/Other/DynamicStack.swift +++ b/Sources/UIComponent/Components/Layout/Other/DynamicStack.swift @@ -6,7 +6,6 @@ // import UIKit -import BaseToolbox /// A component that lays out its children horizontally in a paging fashion similar to an ``HStack``. /// However, instead of creating the child components all at once, it creates them on demand when it needs to render the specific cell. @@ -123,7 +122,7 @@ extension DynamicStackRenderNode { let mainSize = main(constraintSize) + spacing let crossSize = cross(constraintSize) let start = Int(main(frame.origin) / mainSize) - let end = Int((main(frame.bottomRight) - 0.1) / mainSize) + let end = Int((main(CGPoint(x: frame.maxX, y: frame.maxY)) - 0.1) / mainSize) let indexes = start...end let childConstraint = Constraint(minSize: size(main: main(constraintSize), cross: alignItems == .stretch ? cross(constraintSize) : -.infinity), maxSize: constraintSize) return indexes.map { i in