Title: fix(ios): honor corner-shape: squircle for non-uniform border radii by aleclarson · Pull Request #11451 · NativeScript/NativeScript · GitHub
Open Graph Title: fix(ios): honor corner-shape: squircle for non-uniform border radii by aleclarson · Pull Request #11451 · NativeScript/NativeScript
X Title: fix(ios): honor corner-shape: squircle for non-uniform border radii by aleclarson · Pull Request #11451 · NativeScript/NativeScript
Description: PR Checklist The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#commit-messages. There is an issue for the bug/feature this PR is for. To avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it. You have signed the CLA. All existing tests are passing: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/DevelopmentWorkflow.md#running-unit-tests-application. Tests for the changes are included - https://github.com/NativeScript/NativeScript/blob/master/tools/notes/WritingUnitTests.md. What is the current behavior? #11365 added corner-shape: squircle support by mapping it to CALayer.cornerCurve — but only on the uniform border-radius path, where the view's own cornerRadius does the rounding. Views with non-uniform radii (e.g. border-radius: 16px 16px 0 0, a bottom sheet with rounded top corners) are instead clipped by a CAShapeLayer mask built from custom CGPath generators — and those generators hardcode CGPathAddArcToPoint/CGPathAddArc, so corner-shape is silently ignored. What is the new behavior? The non-uniform path generators honor background.cornerShape. A new addSquircleArcToPoint helper draws each corner as a sampled n=4 superellipse (the curve the CSS spec defines for corner-shape: squircle, and the closest parametric approximation of Apple's continuous corner — CAShapeLayer has no cornerCurve equivalent for custom paths). It is wired into: generateNonUniformBorderOuterClipPath (view mask, LayerMask.BORDER) generateNonUniformBorderInnerClipPath (uniform-color border fill) generateShadowLayerPaths (box-shadow inner/mask + shadow paths, both uniform and non-uniform radius cases) generateNonUniformBorderOuterClipRoundedPath (bounds-animation path updates) cornerShape: round output is byte-for-byte what it was before — the circular-arc calls remain untouched behind if (squircle) branches. Implementation note: each quarter arc is emitted as a 12-segment polyline (SQUIRCLE_CORNER_STEPS). Corner masks are rasterized once per bounds change, so the sampling is visually indistinguishable at screen scale while keeping the code dependency-free. Happy to switch to cubic Bézier segments if reviewers prefer — the polyline keeps the math readable but a two-curve fit would shrink the element count. Testing The unit suite can't exercise real CGPath/CAShapeLayer code, so I verified on an iOS 26.5 simulator: Uniform radius + corner-shape: squircle → layer.cornerCurve === 'continuous' (unchanged behavior). Non-uniform radius (20pt top corners) + corner-shape: squircle → layer.mask is a CAShapeLayer whose path containsPoint a coordinate that lies inside a squircle but outside a circular arc of the same radius — confirming the mask is the superellipse, not a circle. A near-vertex control point correctly reports outside. corner-shape unset/round → identical mask path shape as before. Refs #11365.
Open Graph Description: PR Checklist The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#commit-messages. There is an issue for the bug/feature this...
X Description: PR Checklist The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#commit-messages. There is an issue for the bug/feature this...
Opengraph URL: https://github.com/NativeScript/NativeScript/pull/11451
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:35dfd841-9358-f703-3830-82a9dfc61d0b |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | AB5A:21BD98:B527FC:E49F64:6B013037 |
| html-safe-nonce | 5c1bd4729ff14032dbec9e76dd2871824f10dc68bd379b52b082e99e45640ecf |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQjVBOjIxQkQ5ODpCNTI3RkM6RTQ5RjY0OjZCMDEzMDM3IiwidmlzaXRvcl9pZCI6IjY3MjM3NDIxMzIyNjUzNjU1NTkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 5794771ad34e1d0d69d7044e7d7b2e85472dbb9c48ac430a30527b1c79a31916 |
| hovercard-subject-tag | pull_request:4640875739 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/NativeScript/NativeScript/pull/11451/files |
| twitter:image | https://avatars.githubusercontent.com/u/1925840?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1925840?s=400&v=4 |
| og:image:alt | PR Checklist The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#commit-messages. There is an issue for the bug/feature this... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/NativeScript/NativeScript git https://github.com/NativeScript/NativeScript.git |
| octolytics-dimension-user_id | 7392261 |
| octolytics-dimension-user_login | NativeScript |
| octolytics-dimension-repository_id | 31492490 |
| octolytics-dimension-repository_nwo | NativeScript/NativeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 31492490 |
| octolytics-dimension-repository_network_root_nwo | NativeScript/NativeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width