From 0817eaa3012abc0104ffa0d41b844e1c2db1dcc2 Mon Sep 17 00:00:00 2001 From: Gabriel Donadel Date: Tue, 13 Jun 2023 07:29:02 -0700 Subject: [PATCH] Revert "fix: border width top/bottom not matching the border radius" (#37840) Summary: In an effort to fix https://github.com/facebook/react-native/issues/37753, this PR reverts the changes introduced by https://github.com/facebook/react-native/commit/cd6a91343ee24af83c7437b3f2449b41e97760e9 and https://github.com/facebook/react-native/commit/1d5103227851ab92de889d5e7e910393b5d8743a so border-radius width calculations work as expected ## Changelog: [ANDROID] [FIXED] - Fix border-radius width calculations Pull Request resolved: https://github.com/facebook/react-native/pull/37840 Test Plan: Test border colors along with border-radius through RNTester image Reviewed By: dmytrorykun Differential Revision: D46684071 Pulled By: cipolleschi fbshipit-source-id: cf7a80d0d63009b457f03d690b632e332a9b4a02 --- .../views/view/ReactViewBackgroundDrawable.java | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) 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 e1d2519d0cd25e..09128039de2a5a 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 @@ -894,7 +894,7 @@ private void updatePath() { /** Compute mInnerTopLeftCorner */ mInnerTopLeftCorner.x = mInnerClipTempRectForBorderRadius.left; - mInnerTopLeftCorner.y = mInnerClipTempRectForBorderRadius.top * 2; + mInnerTopLeftCorner.y = mInnerClipTempRectForBorderRadius.top; getEllipseIntersectionWithLine( // Ellipse Bounds @@ -920,10 +920,7 @@ private void updatePath() { } mInnerBottomLeftCorner.x = mInnerClipTempRectForBorderRadius.left; - mInnerBottomLeftCorner.y = - borderWidth.bottom != 0 - ? mInnerClipTempRectForBorderRadius.bottom * -2 - : mInnerClipTempRectForBorderRadius.bottom; + mInnerBottomLeftCorner.y = mInnerClipTempRectForBorderRadius.bottom; getEllipseIntersectionWithLine( // Ellipse Bounds @@ -949,7 +946,7 @@ private void updatePath() { } mInnerTopRightCorner.x = mInnerClipTempRectForBorderRadius.right; - mInnerTopRightCorner.y = mInnerClipTempRectForBorderRadius.top * 2; + mInnerTopRightCorner.y = mInnerClipTempRectForBorderRadius.top; getEllipseIntersectionWithLine( // Ellipse Bounds @@ -975,10 +972,7 @@ private void updatePath() { } mInnerBottomRightCorner.x = mInnerClipTempRectForBorderRadius.right; - mInnerBottomRightCorner.y = - borderWidth.bottom != 0 - ? mInnerClipTempRectForBorderRadius.bottom * -2 - : mInnerClipTempRectForBorderRadius.bottom; + mInnerBottomRightCorner.y = mInnerClipTempRectForBorderRadius.bottom; getEllipseIntersectionWithLine( // Ellipse Bounds