Conversation
83082a6 to
5d287f6
Compare
fdd0b16 to
6b32b17
Compare
6b32b17 to
2e89d5b
Compare
🤖 Augment PR SummarySummary: This PR introduces first-class gradient infrastructure and a new Changes:
Technical Notes: The new gradient pipeline relies on 🤖 Was this summary useful? React with 👍 or 👎 |
| var colorSpace: ResolvedGradient.ColorSpace | ||
|
|
||
| func resolve(in environment: EnvironmentValues) -> ResolvedGradient { | ||
| base.resolve(in: environment) |
There was a problem hiding this comment.
Sources/OpenSwiftUICore/Graphic/Gradient/GradientColorSpace.swift:51: ColorSpaceGradientProvider.resolve currently returns base.resolve(in:) without applying colorSpace, so calling .colorSpace(_:) has no effect on the resulting ResolvedGradient.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
|
|
||
| // MARK: - AnchoredResolvedPaint | ||
|
|
||
| package struct AnchoredResolvedPaint<P>: ResolvedPaint where P: ResolvedPaint { |
There was a problem hiding this comment.
Sources/OpenSwiftUICore/Graphic/Color/Paint.swift:154: AnchoredResolvedPaint doesn’t override resolvedGradient, so wrapping a gradient paint with bounds makes AnyResolvedPaint.resolvedGradient become nil (and also prevents visitors that cast to LinearGradient._Paint from matching the underlying paint type).
Severity: high
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| private mutating func setColorSpace(_ colorSpace: ResolvedGradient.ColorSpace) { | ||
| guard self.colorSpace != colorSpace else { return } | ||
| for i in stops.indices { | ||
| stops[i].color = colorSpace.convertIn(colorSpace.convertOut(stops[i].color)) |
There was a problem hiding this comment.
Sources/OpenSwiftUICore/Graphic/Gradient/Gradient.swift:425: ResolvedGradientVector.setColorSpace converts using colorSpace.convertOut(...) on an InterpolatableColor that is still encoded in the previous self.colorSpace, which likely corrupts colors when mixing/animating gradients across different color spaces.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| let li = stops[i].interpolation ?? .linear | ||
| let ri = other.stops[i].interpolation ?? .linear | ||
| stops[i].interpolation = BezierTimingFunction<Float>( | ||
| p1: (li.p1x * scale + ri.p1x, li.p1y * scale + ri.p1y), |
There was a problem hiding this comment.
Sources/OpenSwiftUICore/Graphic/Gradient/Gradient.swift:384: In add(_ other:scaledBy:), the Bezier timing-function components apply scale to li (lhs) rather than ri (rhs), so lhs += rhs * scale behaves incorrectly for stop interpolations during animation.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
Block by OpenSwiftUICore.LinearGradient._Paint swift_dynamicCast