Skip to content

Commit

Permalink
Fix outline drawing 1px width when outlineWidth = 0 (#46586)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #46586

When Paint.strokeWidth is set to 0 its not actually 0 but "hairline mode" so  the fix is just to make outline not draw at all when outlineWidth = 0 {F1879399325}

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D63136220
  • Loading branch information
jorge-cab authored and facebook-github-bot committed Sep 23, 2024
1 parent 3c54e1e commit f70ee1a
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ internal class OutlineDrawable(
((outlinePaint.alpha / 255f) / (Color.alpha(outlineColor) / 255f) * 255f).roundToInt()

override fun draw(canvas: Canvas) {
if (outlineWidth == 0f) {
return
}

pathForOutline.reset()

computedBorderRadius =
Expand Down

0 comments on commit f70ee1a

Please sign in to comment.