Fix rotate effect merging for OpenSwiftUI renderer#879
Conversation
|
/uitest |
🤖 Augment PR SummarySummary: Fixes display-list transform merging so 2D rotations are accumulated into the affine state for the OpenSwiftUI renderer. 🤖 Was this summary useful? React with 👍 or 👎 |
| state.transform = transform.concatenating(state.transform) | ||
| if let affineTransform = transform.affineTransform { | ||
| state.transform = affineTransform.concatenating(state.transform) | ||
| state.adjust(for: affineTransform) |
There was a problem hiding this comment.
transform.affineTransform now includes .rotation, so state.adjust(for:) will run for arbitrary rotation matrices. adjust(for:) derives a scale factor from CGSize(width: 1, height: 1).applying(transform).width, which can be 0/negative for pure rotations (e.g. 45°/90°) and may blow up/flip inherited shadow/blur radii.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #879 +/- ##
==========================================
- Coverage 26.95% 26.95% -0.01%
==========================================
Files 678 678
Lines 47146 47139 -7
==========================================
- Hits 12706 12704 -2
+ Misses 34440 34435 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Close #878
Agent Summary
This updates display-list transform merging so 2D rotation effects are folded into the accumulated affine transform path, while projection and 3D rotation effects only require item-level rendering when they are non-identity.
It also restores the rotate-related UI snapshot suites for the OpenSwiftUI renderer:
RotationEffectUITestsRotation3DEffectUITestsZStackIndexUITests.rotateOverlapThe previous merge behavior could leave rotate effects on the renderer-backed path with an incorrect view hierarchy. This keeps the affine transform state updated for 2D rotation and re-enables the matching UI coverage.
Validation
xcrun swift build --target OpenSwiftUICore