diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java index 09128039de2a5a..e53adafcf08a16 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java @@ -584,6 +584,7 @@ private void updatePath() { } // Clip border ONLY if its color is non transparent + float pathAdjustment = 0f; if (Color.alpha(colorLeft) != 0 && Color.alpha(colorTop) != 0 && Color.alpha(colorRight) != 0 @@ -594,6 +595,10 @@ private void updatePath() { mInnerClipTempRectForBorderRadius.bottom -= borderWidth.bottom; mInnerClipTempRectForBorderRadius.left += borderWidth.left; mInnerClipTempRectForBorderRadius.right -= borderWidth.right; + + // only close gap between border and main path if we draw the border, otherwise + // we wind up pixelating small pixel-radius curves + pathAdjustment = mGapBetweenPaths; } mTempRectForCenterDrawPath.top += borderWidth.top * 0.5f; @@ -721,10 +726,10 @@ private void updatePath() { // (mInnerClipTempRectForBorderRadius), ensuring the border can be // drawn on top without the gap. mBackgroundColorRenderPath.addRoundRect( - mInnerClipTempRectForBorderRadius.left - mGapBetweenPaths, - mInnerClipTempRectForBorderRadius.top - mGapBetweenPaths, - mInnerClipTempRectForBorderRadius.right + mGapBetweenPaths, - mInnerClipTempRectForBorderRadius.bottom + mGapBetweenPaths, + mInnerClipTempRectForBorderRadius.left - pathAdjustment, + mInnerClipTempRectForBorderRadius.top - pathAdjustment, + mInnerClipTempRectForBorderRadius.right + pathAdjustment, + mInnerClipTempRectForBorderRadius.bottom + pathAdjustment, new float[] { innerTopLeftRadiusX, innerTopLeftRadiusY,