Skip to content

Commit

Permalink
Fix outline drawing 1px width when outlineWidth = 0
Browse files Browse the repository at this point in the history
Summary:
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]

Differential Revision: D63136220
  • Loading branch information
jorge-cab authored and facebook-github-bot committed Sep 20, 2024
1 parent 1747f57 commit 0b8a716
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 0b8a716

Please sign in to comment.