diff --git a/Sources/SkipUI/SkipUI/Graphics/Gradient.swift b/Sources/SkipUI/SkipUI/Graphics/Gradient.swift index f50a467b..826cc779 100644 --- a/Sources/SkipUI/SkipUI/Graphics/Gradient.swift +++ b/Sources/SkipUI/SkipUI/Graphics/Gradient.swift @@ -141,7 +141,9 @@ public struct LinearGradient : ShapeStyle, Renderable { @Composable override func asBrush(opacity: Double, animationContext: ComposeContext?) -> Brush? { let stops = gradient.colorStops(opacity: opacity) - return LinearGradientShaderBrush(colorStops: stops, startPoint: startPoint, endPoint: endPoint) + return remember(gradient, startPoint, endPoint, opacity) { + LinearGradientShaderBrush(colorStops: stops, startPoint: startPoint, endPoint: endPoint) + } } private struct LinearGradientShaderBrush: ShaderBrush {