Skip to content

Commit

Permalink
make render node init public
Browse files Browse the repository at this point in the history
  • Loading branch information
lkzhao committed Jan 18, 2025
1 parent 503f23e commit 1340d33
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Sources/UIComponent/Components/Layout/Stack/StackRenderNode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ public struct HorizontalRenderNode: StackRenderNode, HorizontalLayoutProtocol {
public var shouldRenderView: Bool {
false
}

public init(size: CGSize, children: [any RenderNode], positions: [CGPoint], mainAxisMaxValue: CGFloat) {
self.size = size
self.children = children
self.positions = positions
self.mainAxisMaxValue = mainAxisMaxValue
}
}

/// A type of render node that is optimized for vertical layout.
Expand All @@ -76,6 +83,13 @@ public struct VerticalRenderNode: StackRenderNode, VerticalLayoutProtocol {
public var shouldRenderView: Bool {
false
}

public init(size: CGSize, children: [any RenderNode], positions: [CGPoint], mainAxisMaxValue: CGFloat) {
self.size = size
self.children = children
self.positions = positions
self.mainAxisMaxValue = mainAxisMaxValue
}
}

/// A type of render node for generic layout use
Expand Down

0 comments on commit 1340d33

Please sign in to comment.