Repository navigation
Fix per-side border colors drawing outside the view on Android - #59787
Merged
javache merged 3 commits intoNov 18, 2026
Merged
Conversation
Contributor
|
Could you add the example to RNTester that demonstrates the issue so we can prevent regressions? |
Contributor
Author
|
done, added a "changing to per-side colors" example to the border examples and a step in the border visual test that captures it after the change. |
javache
approved these changes
Nov 4, 2026
|
@javache has imported this pull request. If you are a Meta employee, you can view this in D129590218. |
christophpurrer
approved these changes
Nov 17, 2026
christophpurrer
left a comment
Contributor
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
Contributor
|
Can you rebase this diff? CI seems stuck on some builds. |
When a border without a radius has different colors per side, BorderDrawable draws each side as a filled quadrilateral, but that branch never set the paint's style. A drawable first drawn with one border color leaves its paint on STROKE with the border width, so after a change to per-side colors the sides were stroked and spilled outside the view. Set the style to FILL there, as the rounded branch already does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er colors Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
shubh73
force-pushed
the
fix/android-border-quadrilateral-style
branch
from
November 18, 2026 11:12
445d20a to
78d3e25
Compare
Contributor
Author
|
rebased |
meta-codesync Bot
pushed a commit
that referenced
this pull request
Nov 19, 2026
The `Visual regression (android)` and `(ios)` checks fail on any difference, and applying `visual-change-approved` only passes the `Visual regression approval` gate, so an approved PR still shows two red checks - eg #59787, where both platforms only differ by the new test it adds. This makes the platform checks neutral when there are differences, so the gate is the only visual check that fails, and only until the differences are approved. None of the visual checks are required, and a neutral check doesn't fail a PR's overall status. Removing the label, or a push that changes the differences, fails the gate again as before. Changelog: [Internal] Test plan: New unit test. Also ran the compare step's `report` against #59787's real report with the GitHub API mocked: both platform checks post `neutral`, and the gate posts `failure` without the label and `success` ("approved by @javache") with it. Differential Revision: D132905555 Pull Request resolved: #60110
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.


Summary:
On Android, a border without a radius that changes from one color to per-side colors is drawn wrong: each side spills outside the view.
With per-side colors,
BorderDrawable.drawRectangularBordersdraws each side as a filled quadrilateral, but never sets the paint's style. Drawing the border with one color leaves the paint onSTROKEwith the border width, so after the change each quadrilateral is stroked instead of filled.drawRoundedBordersalready setsFILLfor per-side colors; this does the same here. It's the same kind of leftover paint state as #59607.Changelog:
[ANDROID] [FIXED] - Fix per-side border colors drawing outside the view after the border had a single color
Test Plan:
Added
unevenBorderColorsAreFilledAfterAUniformBorderColorWasDrawntoBorderDrawableTest. It fails onmain(STROKEinstead ofFILL) and passes with this change.Added a
Changing to per-side colorsexample to RNTester's Border examples, and a step to the Border visual test that taps it and capturesborder/color-change/per-side-colors, so a regression shows up as a visual diff. Ran the Border flow with Maestro 2.6.1 on an OPPO K12x 5G (CPH2667, Android 16) against RNTester Release built with and without the fix:Without the fix, the new capture shows each side spilling outside the box; with it, the four sides sit inside the box. Two runs of each build gave byte-identical captures, and the existing
corner-radii,child-clipping-radiusandequal-width-borderscaptures are identical with and without the fix.Also checked in RNTester on an OPPO K12x 5G (CPH2667, Android 16) and a Pixel 9 emulator (API 36) with:
Other borders and backgrounds on the same screen (solid, dashed and dotted, radii, per-side widths, translucent colors) are pixel-identical before and after.
yarn format-check-kotlinpasses.🤖 Generated with Claude Code