diff --git a/Sources/Flow/Internal/Layout.swift b/Sources/Flow/Internal/Layout.swift index f46c2790..b8536818 100644 --- a/Sources/Flow/Internal/Layout.swift +++ b/Sources/Flow/Internal/Layout.swift @@ -145,7 +145,7 @@ struct FlowLayout: Sendable { cache: FlowLayoutCache ) -> Lines { let sizes: [Size] = zip(cache.subviewsCache, subviews).map { cache, subview in - if cache.ideal.fits(in: proposedSize) { + if cache.ideal.breadth <= proposedSize.value(on: axis) { cache.ideal } else { subview.sizeThatFits(proposedSize).size(on: axis) diff --git a/Sources/Flow/Internal/Size.swift b/Sources/Flow/Internal/Size.swift index 57cdf4f8..de7f47f9 100644 --- a/Sources/Flow/Internal/Size.swift +++ b/Sources/Flow/Internal/Size.swift @@ -34,17 +34,6 @@ struct Size: Sendable { case .vertical: \.depth } } - - @usableFromInline - func fits(in proposedSize: ProposedViewSize) -> Bool { - if let proposedWidth = proposedSize.width, self[.horizontal] > proposedWidth { - return false - } - if let proposedHeight = proposedSize.height, self[.vertical] > proposedHeight { - return false - } - return true - } } extension Axis {