Skip to content

feat(path): refine nullability and add portable applier, interpolation, and serialization - #41

Merged
Kyle-Ye merged 5 commits into
mainfrom
feature/path_shape
Nov 21, 2026
Merged

Kyle-Ye merged 5 commits into
mainfrom
feature/path_shape

Conversation

@Kyle-Ye

@Kyle-Ye Kyle-Ye commented Nov 21, 2026

Copy link
Copy Markdown
Member

Update ORBPath nullability annotations and expand the !OPENRENDERBOX_CF_CGTYPES portable backend:

  • Mark ORBPathStorageAppendElement's points parameter (and ORBPath.Storage.append(element:points:userInfo:)), ORBPathCopyData's return value, and ORBPathMakeWithData's data parameter as nullable across native headers, implementations, and portable Swift APIs.
  • Add ORBPath.applyCGPathElements(transform:info:callback:) to the portable backend, supporting CGPath-backed paths and element records with optional affine transforms and early-stop propagation.
  • Add ORBPath.canInterpolate(to:) and ORBPath.interpolated(to:fraction:) to the portable backend, including affine matrix polar decomposition, stroke metadata interpolation, and rounded-rect promotion.
  • Add ORBPath.data (CFData?) and ORBPath.init(data:) (CFData?) wire-format encoding and decoding to the portable backend.
  • Update DarwinPrivateFrameworks to 600fcdfb and OpenCoreGraphics to 9f247e28 in Package.resolved.

Dependency

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T15:46:36.099344Z 8116467 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +978 to +980
if sx == 0 {
if d == 0 {
return _ORBAffineComponents(scaleWidth: 0, scaleHeight: 0, horizontalShear: 0, rotation: 0, translationDX: tx, translationDY: ty)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines +478 to +479
var record = _ORBPathRecord(element: element, values: values)
if (code & 0x80) != 0 {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.00000% with 256 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.97%. Comparing base (f8b4f1f) to head (8116467).

Files with missing lines Patch % Lines
Sources/OpenRenderBox/Path/ORBPathData.swift 44.94% 207 Missing ⚠️
Sources/OpenRenderBox/Path/ORBPath.swift 81.32% 45 Missing ⚠️
Sources/OpenRenderBox/Path/ORBPathCFData.swift 77.77% 4 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Kyle-Ye
Kyle-Ye merged commit 49db676 into main Nov 21, 2026
4 checks passed
@Kyle-Ye
Kyle-Ye deleted the feature/path_shape branch November 21, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants