Repository navigation
feat(path): refine nullability and add portable applier, interpolation, and serialization - #41
Conversation
…ata serialization
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8116467243
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if sx == 0 { | ||
| if d == 0 { | ||
| return _ORBAffineComponents(scaleWidth: 0, scaleHeight: 0, horizontalShear: 0, rotation: 0, translationDX: tx, translationDY: ty) |
There was a problem hiding this comment.
Preserve the nonzero column when decomposing singular transforms
When a transform has a == b == d == 0 but c != 0, this branch discards the nonzero second column and decomposes the matrix as an all-zero linear transform. For example, interpolating (a: 0, b: 0, c: 1, d: 0) toward identity produces an almost-zero matrix at fraction 0.000001, rather than approaching the source matrix. This makes paths jump discontinuously at the start or end of animations involving a rotated zero-scale transform. Preserve the surviving column, or use a fallback interpolation that handles singular matrices.
Useful? React with 👍 / 👎.
| var record = _ORBPathRecord(element: element, values: values) | ||
| if (code & 0x80) != 0 { |
There was a problem hiding this comment.
Restore default metadata when decoding stroke records
For a storage-backed stroke with default metadata (lineCap: 0, lineJoin: 0, and an empty dash array), such as one returned by interpolated(to:fraction:), the encoder omits the metadata field, but this decoder leaves record.stroke as nil. Consequently, even with exactly representable integer coordinates, serializing and decoding that path makes decoded.isEqual(to: original) return false: both paths use _orbRecordCallbacks, whose equality compares the stored optional stroke metadata directly. Initialize omitted stroke metadata to its default value, or normalize defaults in record equality, so serialization preserves path equality.
Useful? React with 👍 / 👎.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #41 +/- ##
==========================================
+ Coverage 62.39% 63.97% +1.58%
==========================================
Files 15 17 +2
Lines 1420 2057 +637
==========================================
+ Hits 886 1316 +430
- Misses 534 741 +207 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Update
ORBPathnullability annotations and expand the!OPENRENDERBOX_CF_CGTYPESportable backend:ORBPathStorageAppendElement'spointsparameter (andORBPath.Storage.append(element:points:userInfo:)),ORBPathCopyData's return value, andORBPathMakeWithData'sdataparameter as nullable across native headers, implementations, and portable Swift APIs.ORBPath.applyCGPathElements(transform:info:callback:)to the portable backend, supportingCGPath-backed paths and element records with optional affine transforms and early-stop propagation.ORBPath.canInterpolate(to:)andORBPath.interpolated(to:fraction:)to the portable backend, including affine matrix polar decomposition, stroke metadata interpolation, and rounded-rect promotion.ORBPath.data(CFData?) andORBPath.init(data:)(CFData?) wire-format encoding and decoding to the portable backend.DarwinPrivateFrameworksto600fcdfbandOpenCoreGraphicsto9f247e28inPackage.resolved.Dependency