Android: honour per-corner border radii on images - #55
Open
gwleuverink wants to merge 2 commits into
Open
Conversation
gwleuverink
marked this pull request as ready for review
August 20, 2026 11:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes NativePHP/mobile-air#355.
<native:image>ignored per-corner radii on Android.rounded-3xl rounded-br-nonegave a fully rounded image next to a column with the sharp corner, androunded-tl-3xl rounded-tr-3xlrendered the image completely square. iOS was already correct, because it clips in the sharedNodeStyleModifierrather than in the renderer.The renderer only ever saw the uniform radius:
Containers don't do that. They go through
nodeShape(radius, props), which reads theradius_tl/tr/br/blprops PHP emits whenever any corner is authored. So the image now calls the same helper:The guard matters as much as the shape. A node with only per-corner radii carries no uniform radius, so the old
radius > 0fcheck skipped clipping altogether, which is why the top-corners-only case came out square instead of half right.The version bump
nodeShapeshipped in mobile 4.2.0 while this package requires^4.0, so I bumped it to^4.2.That constraint is already wrong on main, though:
NativeUIBackgroundLayerHost.ktimportsLocalBackgroundLayerPresent, which first shipped in 4.1.0. Install this plugin against mobile 4.0.x today and its Kotlin fails to compile in the app build. CI won't tell you either, the workflow parses Swift only and leaves Android syntax to the consuming app build. So the bump also closes a break that predates this PR.Verification
A column and an image side by side on identical classes, five cases, on an API 36 emulator:
D and E are there for the clamp: a radius larger than the element. The image clamps the same way the column does, pill for pill and swoop for swoop.
iOS rebuilt and compared pixel for pixel against the pre-fix screenshot over the area holding the rows, no difference. Nothing in this diff touches an iOS path.
No test comes with this. The
.ktfiles here are loose sources compiled inside the consuming app, so there's no harness that could cover a renderer, and the wire contract the guard depends on is already pinned in mobile-air'sTailwindParserTest(all four corners emitted whenever any is authored, each resolved against the uniform radius).