Skip to content

Commit

Permalink
Update yoga to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
cntrump committed Sep 30, 2023
1 parent 669039a commit d12f736
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 30 deletions.
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"pins": [
{
"package": "yoga",
"repositoryURL": "https://github.com/facebook/yoga",
"repositoryURL": "https://github.com/facebook/yoga.git",
"state": {
"branch": "main",
"revision": "ef5784aca647a68343f5409e379519827edb86a9",
"revision": "a8566a01503e283f2e06fdcb12b80603035aadb1",
"version": null
}
}
Expand Down
22 changes: 0 additions & 22 deletions Sources/SwiftYoga/YGConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,6 @@ extension YGConfig {
}
}

// Yoga previously had an error where containers would take the maximum space
// possible instead of the minimum like they are supposed to. In practice this
// resulted in implicit behaviour similar to align-self: stretch; Because this
// was such a long-standing bug we must allow legacy users to switch back to
// this behaviour.
public var useLegacyStretchBehaviour: Bool {
@available(*, deprecated, message: "Please use \"YGConfigGetErrata()\"")
get {
return YGConfigGetUseLegacyStretchBehaviour(configRef)
}

@available(*, deprecated, message: "\"YGConfigSetUseLegacyStretchBehaviour\" will be removed in the next release. Usage should be replaced with \"YGConfigSetErrata(YGErrataAll)\" to opt out of all future breaking conformance fixes, or \"YGConfigSetErrata(YGErrataStretchFlexBasis)\" to opt out of the specific conformance fix previously disabled by \"UseLegacyStretchBehaviour\".")
set {
YGConfigSetUseLegacyStretchBehaviour(configRef, newValue)
}
}

public var experimentalFeatures: YGExperimentalFeature {
get {
var features = YGExperimentalFeature()
Expand All @@ -69,17 +52,12 @@ extension YGConfig {
features.insert(.absolutePercentageAgainstPaddingEdge)
}

if YGConfigIsExperimentalFeatureEnabled(configRef, .fixJNILocalRefOverflows) {
features.insert(.fixJNILocalRefOverflows)
}

return features
}

set {
YGConfigSetExperimentalFeatureEnabled(configRef, .webFlexBasis, newValue.contains(.webFlexBasis))
YGConfigSetExperimentalFeatureEnabled(configRef, .absolutePercentageAgainstPaddingEdge, newValue.contains(.absolutePercentageAgainstPaddingEdge))
YGConfigSetExperimentalFeatureEnabled(configRef, .fixJNILocalRefOverflows, newValue.contains(.fixJNILocalRefOverflows))
}
}

Expand Down
8 changes: 4 additions & 4 deletions Sources/SwiftYoga/YGNode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ extension YGNode {
YGNodeSetMeasureFunc(nodeRef, nil)
}

YGNodeInsertChild(nodeRef, child.nodeRef, UInt32(index))
YGNodeInsertChild(nodeRef, child.nodeRef, index)
children.insert(child, at: index)
}

Expand Down Expand Up @@ -129,8 +129,8 @@ extension YGNode {
}

let dstNode = children[index]
YGNodeSwapChild(nodeRef, child.nodeRef, UInt32(index))
YGNodeSwapChild(nodeRef, dstNode.nodeRef, UInt32(srcIndex))
YGNodeSwapChild(nodeRef, child.nodeRef, index)
YGNodeSwapChild(nodeRef, dstNode.nodeRef, srcIndex)
children.swapAt(srcIndex, index)
}

Expand Down Expand Up @@ -182,7 +182,7 @@ extension YGNode {
return
}

YGNodeSwapChild(nodeRef, child.nodeRef, UInt32(lastIndex))
YGNodeSwapChild(nodeRef, child.nodeRef, lastIndex)
children.swapAt(srcIndex, lastIndex)
}

Expand Down
2 changes: 0 additions & 2 deletions Sources/SwiftYoga/YGStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ extension YGExperimentalFeature: OptionSet {
public static let webFlexBasis = YGExperimentalFeatureWebFlexBasis

public static let absolutePercentageAgainstPaddingEdge = YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge

public static let fixJNILocalRefOverflows = YGExperimentalFeatureFixJNILocalRefOverflows
}

extension YGFlexDirection {
Expand Down

0 comments on commit d12f736

Please sign in to comment.