Skip to content

Commit

Permalink
fix: border width top/bottom not matching the border radius (#34362)
Browse files Browse the repository at this point in the history
Summary:
Fixes #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: #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
  • Loading branch information
hurali97 authored and facebook-github-bot committed Aug 26, 2022
1 parent 8afa04a commit cd6a913
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ private void updatePath() {

/** Compute mInnerTopLeftCorner */
mInnerTopLeftCorner.x = mInnerClipTempRectForBorderRadius.left;
mInnerTopLeftCorner.y = mInnerClipTempRectForBorderRadius.top;
mInnerTopLeftCorner.y = mInnerClipTempRectForBorderRadius.top * 2;

getEllipseIntersectionWithLine(
// Ellipse Bounds
Expand All @@ -817,7 +817,7 @@ private void updatePath() {
}

mInnerBottomLeftCorner.x = mInnerClipTempRectForBorderRadius.left;
mInnerBottomLeftCorner.y = mInnerClipTempRectForBorderRadius.bottom;
mInnerBottomLeftCorner.y = mInnerClipTempRectForBorderRadius.bottom * -2;

getEllipseIntersectionWithLine(
// Ellipse Bounds
Expand All @@ -843,7 +843,7 @@ private void updatePath() {
}

mInnerTopRightCorner.x = mInnerClipTempRectForBorderRadius.right;
mInnerTopRightCorner.y = mInnerClipTempRectForBorderRadius.top;
mInnerTopRightCorner.y = mInnerClipTempRectForBorderRadius.top * 2;

getEllipseIntersectionWithLine(
// Ellipse Bounds
Expand All @@ -869,7 +869,7 @@ private void updatePath() {
}

mInnerBottomRightCorner.x = mInnerClipTempRectForBorderRadius.right;
mInnerBottomRightCorner.y = mInnerClipTempRectForBorderRadius.bottom;
mInnerBottomRightCorner.y = mInnerClipTempRectForBorderRadius.bottom * -2;

getEllipseIntersectionWithLine(
// Ellipse Bounds
Expand Down

0 comments on commit cd6a913

Please sign in to comment.