Skip to content

Commit

Permalink
Fix small border radius getting capped (#46251)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #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
  • Loading branch information
jorge-cab authored and facebook-github-bot committed Aug 30, 2024
1 parent 56937d6 commit 6f88a60
Showing 1 changed file with 8 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -767,42 +767,14 @@ private void updatePath() {
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);

Expand Down

0 comments on commit 6f88a60

Please sign in to comment.