mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix: specific border radius corner causes visual bug on other corners (#24390)
Summary: Fixes #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: https://github.com/facebook/react-native/pull/24390 Differential Revision: D14870476 Pulled By: cpojer fbshipit-source-id: df40fc584a2f8badc499413cb3c4e4d96b9e18cf
This commit is contained in:
committed by
Facebook Github Bot
parent
037d16ba72
commit
a05b409b38
+8
-8
@@ -662,14 +662,14 @@ public class ReactViewBackgroundDrawable extends Drawable {
|
||||
mCenterDrawPath.addRoundRect(
|
||||
mTempRectForCenterDrawPath,
|
||||
new float[] {
|
||||
innerTopLeftRadiusX + extraRadiusForOutline,
|
||||
innerTopLeftRadiusY + extraRadiusForOutline,
|
||||
innerTopRightRadiusX + extraRadiusForOutline,
|
||||
innerTopRightRadiusY + extraRadiusForOutline,
|
||||
innerBottomRightRadiusX + extraRadiusForOutline,
|
||||
innerBottomRightRadiusY + extraRadiusForOutline,
|
||||
innerBottomLeftRadiusX + extraRadiusForOutline,
|
||||
innerBottomLeftRadiusY + extraRadiusForOutline
|
||||
innerTopLeftRadiusX + (innerTopLeftRadiusX > 0 ? extraRadiusForOutline : 0),
|
||||
innerTopLeftRadiusY + (innerTopLeftRadiusY > 0 ? extraRadiusForOutline : 0),
|
||||
innerTopRightRadiusX + (innerTopRightRadiusX > 0 ? extraRadiusForOutline : 0),
|
||||
innerTopRightRadiusY + (innerTopRightRadiusY > 0 ? extraRadiusForOutline : 0),
|
||||
innerBottomRightRadiusX + (innerBottomRightRadiusX > 0 ? extraRadiusForOutline : 0),
|
||||
innerBottomRightRadiusY + (innerBottomRightRadiusY > 0 ? extraRadiusForOutline : 0),
|
||||
innerBottomLeftRadiusX + (innerBottomLeftRadiusX > 0 ? extraRadiusForOutline : 0),
|
||||
innerBottomLeftRadiusY + (innerBottomLeftRadiusY > 0 ? extraRadiusForOutline : 0)
|
||||
},
|
||||
Path.Direction.CW);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user