Skip to content

Commit a05b409

Browse files
Nizariusfacebook-github-bot
authored andcommitted
Fix: specific border radius corner causes visual bug on other corners (facebook#24390)
Summary: Fixes facebook#22511 I understand the motivation of adding extraRadiusForOutline to corner radius: without it there can be an empty space between border and view's background color. So I add simple check: if corner radius is more than zero we still add extraRadiusForOutline. And if not, we don't add it to prevent all the corners to become slightly curved. [GENERAL] [Fixed] - fix of Android's bug that causes all the corners to become slightly curved if only specific corners' radius should be more than zero. Pull Request resolved: facebook#24390 Differential Revision: D14870476 Pulled By: cpojer fbshipit-source-id: df40fc584a2f8badc499413cb3c4e4d96b9e18cf
1 parent 037d16b commit a05b409

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -662,14 +662,14 @@ private void updatePath() {
662662
mCenterDrawPath.addRoundRect(
663663
mTempRectForCenterDrawPath,
664664
new float[] {
665-
innerTopLeftRadiusX + extraRadiusForOutline,
666-
innerTopLeftRadiusY + extraRadiusForOutline,
667-
innerTopRightRadiusX + extraRadiusForOutline,
668-
innerTopRightRadiusY + extraRadiusForOutline,
669-
innerBottomRightRadiusX + extraRadiusForOutline,
670-
innerBottomRightRadiusY + extraRadiusForOutline,
671-
innerBottomLeftRadiusX + extraRadiusForOutline,
672-
innerBottomLeftRadiusY + extraRadiusForOutline
665+
innerTopLeftRadiusX + (innerTopLeftRadiusX > 0 ? extraRadiusForOutline : 0),
666+
innerTopLeftRadiusY + (innerTopLeftRadiusY > 0 ? extraRadiusForOutline : 0),
667+
innerTopRightRadiusX + (innerTopRightRadiusX > 0 ? extraRadiusForOutline : 0),
668+
innerTopRightRadiusY + (innerTopRightRadiusY > 0 ? extraRadiusForOutline : 0),
669+
innerBottomRightRadiusX + (innerBottomRightRadiusX > 0 ? extraRadiusForOutline : 0),
670+
innerBottomRightRadiusY + (innerBottomRightRadiusY > 0 ? extraRadiusForOutline : 0),
671+
innerBottomLeftRadiusX + (innerBottomLeftRadiusX > 0 ? extraRadiusForOutline : 0),
672+
innerBottomLeftRadiusY + (innerBottomLeftRadiusY > 0 ? extraRadiusForOutline : 0)
673673
},
674674
Path.Direction.CW);
675675

0 commit comments

Comments
 (0)