File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7474 </viewController >
7575 <placeholder placeholderIdentifier =" IBFirstResponder" id =" NVa-Eg-Ijb" userLabel =" First Responder" customClass =" UIResponder" sceneMemberID =" firstResponder" />
7676 </objects >
77- <point key =" canvasLocation" x =" 3648 " y =" -550 " />
77+ <point key =" canvasLocation" x =" 1849 " y =" -581 " />
7878 </scene >
7979 <!-- H/VStackView-->
8080 <scene sceneID =" Lai-fH-3ho" >
Original file line number Diff line number Diff line change @@ -62,14 +62,11 @@ open class HStackView: UIView, StackView {
6262 }
6363
6464 public var contentSize : CGSize {
65- let rect = effectiveSubviews. map ( { $0. frame } ) . reduce ( CGRect . zero) { result , rect in
66- result . union ( rect )
67- }
65+ let width = effectiveSubviews. map ( { $0. frame } ) . reduce ( CGRect . zero, { $0 . union ( $1 ) } ) . width
66+ let height = effectiveSubviews . map ( { $0 . bounds . height } ) . max ( ) ?? 0
67+
6868 let offsetXLength = effectiveSubviews. map ( { $0. frame. minX } ) . filter ( { $0 < 0 } ) . min ( ) ?? 0
69- return CGSize (
70- width: rect. width + paddingRight + offsetXLength,
71- height: rect. height + paddingVertically
72- )
69+ return CGSize ( width: width + paddingRight + offsetXLength, height: height + paddingVertically)
7370 }
7471
7572 open func hideIfNoEffectiveViews( ) {
Original file line number Diff line number Diff line change @@ -62,14 +62,11 @@ open class VStackView: UIView, StackView {
6262 }
6363
6464 public var contentSize : CGSize {
65- let rect = effectiveSubviews. map ( { $0. frame } ) . reduce ( CGRect . zero) { partialResult, rect in
66- partialResult. union ( rect)
67- }
68- let offsetYLength : CGFloat = effectiveSubviews. map ( { $0. frame. origin. y } ) . filter ( { $0 < 0 } ) . min ( ) ?? 0
69- return CGSize (
70- width: rect. width + paddingHorizontally,
71- height: rect. height + paddingBottom + offsetYLength
72- )
65+ let width = effectiveSubviews. map ( { $0. bounds. width } ) . max ( ) ?? 0
66+ let height = effectiveSubviews. map ( { $0. frame } ) . reduce ( CGRect . zero, { $0. union ( $1) } ) . height
67+
68+ let offsetYLength : CGFloat = effectiveSubviews. map ( { $0. frame. minY } ) . filter ( { $0 < 0 } ) . min ( ) ?? 0
69+ return CGSize ( width: width + paddingHorizontally, height: height + paddingBottom + offsetYLength)
7370 }
7471
7572 open func hideIfNoEffectiveViews( ) {
You can’t perform that action at this time.
0 commit comments