From 9c9945a5bfb2e9c9da0810c57e81922ad1dd83c8 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 31a4523569c5c5..110bf7527da06d 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 @@ -891,7 +891,7 @@ private void updatePath() { /** Compute mInnerTopLeftCorner */ mInnerTopLeftCorner.x = mInnerClipTempRectForBorderRadius.left; - mInnerTopLeftCorner.y = mInnerClipTempRectForBorderRadius.top * 2; + mInnerTopLeftCorner.y = mInnerClipTempRectForBorderRadius.top; getEllipseIntersectionWithLine( // Ellipse Bounds @@ -917,10 +917,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 @@ -946,7 +943,7 @@ private void updatePath() { } mInnerTopRightCorner.x = mInnerClipTempRectForBorderRadius.right; - mInnerTopRightCorner.y = mInnerClipTempRectForBorderRadius.top * 2; + mInnerTopRightCorner.y = mInnerClipTempRectForBorderRadius.top; getEllipseIntersectionWithLine( // Ellipse Bounds @@ -972,10 +969,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