Skip to content

Commit

Permalink
1.8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
nathantannar4 committed Jul 11, 2024
1 parent 518c63f commit 391d0da
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Sources/Engine/Sources/GraphInputs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,13 @@ public struct _ViewInputsBridgeModifier: ViewModifier {
extension PropertyList {
fileprivate mutating func detach() {
var ptr = elements
var hasMatchedGeometryScope = false
while let p = ptr {
let key = _typeName(ptr!.keyType, qualified: true)
let key = _typeName(p.keyType, qualified: true)
var isMatch = key.hasSuffix(".MatchedGeometryScope")
if isMatch {
hasMatchedGeometryScope = true
}
#if !os(macOS)
let branchKey: String
if #available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *) {
Expand Down Expand Up @@ -144,11 +148,17 @@ extension PropertyList {
var last = tail.after
tail.after = nil
while let p = last?.after {
if !hasMatchedGeometryScope {
let key = _typeName(p.keyType, qualified: true)
if key.hasSuffix(".MatchedGeometryScope") {
break
}
}
last = p
}

ptr = elements
let offset = tail.length - (last == nil ? 1 : 2)
let offset = tail.length - ((last?.length ?? 0) + 1)
while offset > 0, let p = ptr {
p.length -= offset
ptr = p.after
Expand Down
12 changes: 12 additions & 0 deletions Sources/EngineTests/EngineCoreMultiViewVisitorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,18 @@ final class MultiViewVisitorTests: XCTestCase {
VStack {
Text("Line 3")
}
} validation: { ctx, index in
let base = ViewTypeIdentifier(TupleView<(Text, ModifiedContent<Text, _PaddingLayout>, VStack<Text>)>.self).appending(offset: index)
switch index {
case 0:
XCTAssertEqual(ctx.id, base.appending(Text.self))
case 1:
XCTAssertEqual(ctx.id, base.appending(ModifiedContent<Text, _PaddingLayout>.self))
case 2:
XCTAssertEqual(ctx.id, base.appending(VStack<Text>.self))
default:
XCTFail()
}
}
}

Expand Down

0 comments on commit 391d0da

Please sign in to comment.