Skip to content

Commit cd6a913

Browse files
hurali97facebook-github-bot
authored andcommitted
fix: border width top/bottom not matching the border radius (facebook#34362)
Summary: Fixes facebook#33950 After analysing the values used for drawing the border specifically the top and bottom values of `mInnerClipTempRectForBorderRadius` weren't matching the needs when it comes to the case of borderTopWidth and borderBottomWidth, when the borderRadius is applied. Asking for reviews cortinico ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://reactnative.dev/contributing/changelogs-in-pull-requests --> [Android] [Fixed] - Border width top/bottom not matching the border radius Pull Request resolved: facebook#34362 Test Plan: Tested in a local project, following are the outputs(Details are in the issue attached): Before: <img src="https://user-images.githubusercontent.com/47336142/183289227-96b20f86-1507-46f5-a79d-f61457624e8b.png" height="550"> After: <img src="https://user-images.githubusercontent.com/47336142/183289177-6148df29-f0de-4b99-bdf0-c28a9c7d3ac7.png" height="550"> Reviewed By: hramos Differential Revision: D38805873 Pulled By: lunaleaps fbshipit-source-id: 69f8ff9a9caeeaf88d1c76b639271f642c2e7ea2
1 parent 8afa04a commit cd6a913

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ private void updatePath() {
791791

792792
/** Compute mInnerTopLeftCorner */
793793
mInnerTopLeftCorner.x = mInnerClipTempRectForBorderRadius.left;
794-
mInnerTopLeftCorner.y = mInnerClipTempRectForBorderRadius.top;
794+
mInnerTopLeftCorner.y = mInnerClipTempRectForBorderRadius.top * 2;
795795

796796
getEllipseIntersectionWithLine(
797797
// Ellipse Bounds
@@ -817,7 +817,7 @@ private void updatePath() {
817817
}
818818

819819
mInnerBottomLeftCorner.x = mInnerClipTempRectForBorderRadius.left;
820-
mInnerBottomLeftCorner.y = mInnerClipTempRectForBorderRadius.bottom;
820+
mInnerBottomLeftCorner.y = mInnerClipTempRectForBorderRadius.bottom * -2;
821821

822822
getEllipseIntersectionWithLine(
823823
// Ellipse Bounds
@@ -843,7 +843,7 @@ private void updatePath() {
843843
}
844844

845845
mInnerTopRightCorner.x = mInnerClipTempRectForBorderRadius.right;
846-
mInnerTopRightCorner.y = mInnerClipTempRectForBorderRadius.top;
846+
mInnerTopRightCorner.y = mInnerClipTempRectForBorderRadius.top * 2;
847847

848848
getEllipseIntersectionWithLine(
849849
// Ellipse Bounds
@@ -869,7 +869,7 @@ private void updatePath() {
869869
}
870870

871871
mInnerBottomRightCorner.x = mInnerClipTempRectForBorderRadius.right;
872-
mInnerBottomRightCorner.y = mInnerClipTempRectForBorderRadius.bottom;
872+
mInnerBottomRightCorner.y = mInnerClipTempRectForBorderRadius.bottom * -2;
873873

874874
getEllipseIntersectionWithLine(
875875
// Ellipse Bounds

0 commit comments

Comments
 (0)