Skip to content

Commit 796a624

Browse files
committed
Fix Color.foregroundStyle recursive loop
1 parent ad4afc5 commit 796a624

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
@@ -76,6 +76,7 @@ extension ForegroundStyle {
7676
if shape.activeRecursiveStyles.contains(.foreground) {
7777
LegacyContentStyle.sharedPrimary._apply(to: &shape)
7878
} else {
79+
shape.activeRecursiveStyles.formUnion(.foreground)
7980
shape.effectiveForegroundStyle._apply(to: &shape)
8081
shape.activeRecursiveStyles.subtract(.foreground)
8182
}

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)