Fix small border radius getting capped (#46251)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46251

The diff D21124739 introduced this as a workaround for some faulty logic we used to have.

It seems like we no longer need it and it was actually causing issues with small border radii. Its barely noticeable but Outline looks weird in some cases if we leave it as is

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D61938725

fbshipit-source-id: cf7ee7417e1085d01e2e307e780ff5d1db499e69
This commit is contained in:
Jorge Cabiedes Acosta authored and Facebook GitHub Bot committed 2024-08-30 13:15:35 -07:00
1 parent 56937d646c
commit 6f88a608d2
1 file changed
+8 -36
@@ -767,42 +767,14 @@ public class CSSBackgroundDrawable extends Drawable {
mCenterDrawPath.addRoundRect(
mTempRectForCenterDrawPath,
new float[] {
Math.max(
topLeftRadius.getHorizontal() - borderWidth.left * 0.5f,
(borderWidth.left > 0.0f)
? (topLeftRadius.getHorizontal() / borderWidth.left)
: 0.0f),
Math.max(
topLeftRadius.getVertical() - borderWidth.top * 0.5f,
(borderWidth.top > 0.0f) ? (topLeftRadius.getVertical() / borderWidth.top) : 0.0f),
Math.max(
topRightRadius.getHorizontal() - borderWidth.right * 0.5f,
(borderWidth.right > 0.0f)
? (topRightRadius.getHorizontal() / borderWidth.right)
: 0.0f),
Math.max(
topRightRadius.getVertical() - borderWidth.top * 0.5f,
(borderWidth.top > 0.0f) ? (topRightRadius.getVertical() / borderWidth.top) : 0.0f),
Math.max(
bottomRightRadius.getHorizontal() - borderWidth.right * 0.5f,
(borderWidth.right > 0.0f)
? (bottomRightRadius.getHorizontal() / borderWidth.right)
: 0.0f),
Math.max(
bottomRightRadius.getVertical() - borderWidth.bottom * 0.5f,
(borderWidth.bottom > 0.0f)
? (bottomRightRadius.getVertical() / borderWidth.bottom)
: 0.0f),
Math.max(
bottomLeftRadius.getHorizontal() - borderWidth.left * 0.5f,
(borderWidth.left > 0.0f)
? (bottomLeftRadius.getHorizontal() / borderWidth.left)
: 0.0f),
Math.max(
bottomLeftRadius.getVertical() - borderWidth.bottom * 0.5f,
(borderWidth.bottom > 0.0f)
? (bottomLeftRadius.getVertical() / borderWidth.bottom)
: 0.0f)
topLeftRadius.getHorizontal() - borderWidth.left * 0.5f,
topLeftRadius.getVertical() - borderWidth.top * 0.5f,
topRightRadius.getHorizontal() - borderWidth.right * 0.5f,
topRightRadius.getVertical() - borderWidth.top * 0.5f,
bottomRightRadius.getHorizontal() - borderWidth.right * 0.5f,
bottomRightRadius.getVertical() - borderWidth.bottom * 0.5f,
bottomLeftRadius.getHorizontal() - borderWidth.left * 0.5f,
bottomLeftRadius.getVertical() - borderWidth.bottom * 0.5f,
},
Path.Direction.CW);