| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Pixi 8 CanvasTextSystem reads .width on empty remainder strings when letter-spacing is present. Returning without a metrics object crashes any Pixi Text on NativeScript Canvas.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: f4289e3e-0112-470d-ab6d-74c038caedae You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file. Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. ❤️ ShareComment @coderabbitai help to get the list of available commands. |
Sorry, something went wrong.
|
The red AudioContext jobs are not from this diff.
The last Canvas Native run on master (merge of #149, run 34359199107) failed the same AudioContext jobs (and Canvas iOS/Android). This PR does not touch packages/audio-context. The relevant job for this change is Build Native / Canvas iOS + visionOS. |
Sorry, something went wrong.
Brings in #150 and #151. #151 (window timer / EventTarget aliases) is TypeScript only and merged clean. #150 (TextMetrics for empty measureText) conflicted on the one line this branch spells differently: master reads the length through its canvas::Utf8Length shim, this branch calls Utf8LengthV2 directly. Kept this branch's call and took master's fix, which is the removal of the `if (text_utf8_len == 0) return;` early exit. The rest of MeasureText is safe at length 0: prefix_len is at least 3, so the scratch buffer is never empty, WriteUtf8V2 with a zero length writes nothing, and the empty string measures to a zero-width TextMetrics rather than returning undefined.
| Back | FazBrowse Home | New Git URL |
Problem
Pixi 8 CanvasTextSystem._drawLetterSpacing always calls context.measureText(remainder).width. When the remainder is "", NativeScript Canvas returned without constructing a TextMetrics object, so .width threw and any new Text(...) crashed on iOS/tvOS.
Change
Remove the if (text_utf8_len == 0) return; guard. Empty strings go through the existing text engine/cache and return a metrics instance with width 0, matching browsers.
Test plan
Does not include the concentric-radial Skia experiment; two-point conical already fades correctly on this stack.