Skip to content

Commit

Permalink
Fix: specific border radius corner causes visual bug on other corners (
Browse files Browse the repository at this point in the history
…#24390)

Summary:
Fixes #22511

I understand the motivation of adding extraRadiusForOutline to corner radius: without it there can be an empty space between border and view's background color.

So I add simple check: if corner radius is more than zero we still add extraRadiusForOutline. And if not, we don't add it to prevent all the corners to become slightly curved.

[GENERAL] [Fixed] -  fix of Android's bug that causes all the corners to become slightly curved if only specific corners' radius should be more than zero.
Pull Request resolved: #24390

Differential Revision: D14870476

Pulled By: cpojer

fbshipit-source-id: df40fc584a2f8badc499413cb3c4e4d96b9e18cf
  • Loading branch information
Nizarius authored and facebook-github-bot committed Apr 10, 2019
1 parent 037d16b commit a05b409
Showing 1 changed file with 8 additions and 8 deletions.
Expand Up @@ -662,14 +662,14 @@ private void updatePath() {
mCenterDrawPath.addRoundRect(
mTempRectForCenterDrawPath,
new float[] {
innerTopLeftRadiusX + extraRadiusForOutline,
innerTopLeftRadiusY + extraRadiusForOutline,
innerTopRightRadiusX + extraRadiusForOutline,
innerTopRightRadiusY + extraRadiusForOutline,
innerBottomRightRadiusX + extraRadiusForOutline,
innerBottomRightRadiusY + extraRadiusForOutline,
innerBottomLeftRadiusX + extraRadiusForOutline,
innerBottomLeftRadiusY + extraRadiusForOutline
innerTopLeftRadiusX + (innerTopLeftRadiusX > 0 ? extraRadiusForOutline : 0),
innerTopLeftRadiusY + (innerTopLeftRadiusY > 0 ? extraRadiusForOutline : 0),
innerTopRightRadiusX + (innerTopRightRadiusX > 0 ? extraRadiusForOutline : 0),
innerTopRightRadiusY + (innerTopRightRadiusY > 0 ? extraRadiusForOutline : 0),
innerBottomRightRadiusX + (innerBottomRightRadiusX > 0 ? extraRadiusForOutline : 0),
innerBottomRightRadiusY + (innerBottomRightRadiusY > 0 ? extraRadiusForOutline : 0),
innerBottomLeftRadiusX + (innerBottomLeftRadiusX > 0 ? extraRadiusForOutline : 0),
innerBottomLeftRadiusY + (innerBottomLeftRadiusY > 0 ? extraRadiusForOutline : 0)
},
Path.Direction.CW);

Expand Down

0 comments on commit a05b409

Please sign in to comment.