Skip to content

Commit 782ee14

Browse files
committed
Fix Color.foregroundStyle recursive loop
1 parent a8fe1e8 commit 782ee14

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Sources/OpenSwiftUICore/Shape/ShapeStyle/ForegroundStyle.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ extension ForegroundStyle {
8888
if shape.activeRecursiveStyles.contains(.foreground) {
8989
LegacyContentStyle.sharedPrimary._apply(to: &shape)
9090
} else {
91+
shape.activeRecursiveStyles.formUnion(.foreground)
9192
shape.effectiveForegroundStyle._apply(to: &shape)
9293
shape.activeRecursiveStyles.subtract(.foreground)
9394
}

Sources/OpenSwiftUICore/Shape/ShapeStyle/ShapeStyleShape.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public struct _ShapeStyle_Shape {
104104
}
105105

106106
package var effectiveForegroundStyle: AnyShapeStyle {
107-
environment._effectiveForegroundStyle
107+
foregroundStyle ?? environment._effectiveForegroundStyle
108108
}
109109
}
110110

0 commit comments

Comments
 (0)