Fix outline drawing 1px width when outlineWidth = 0 (#46586)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/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

fbshipit-source-id: 81ef7ce0b72158c6b7c332191d332008c5a919b4
This commit is contained in:
Jorge Cabiedes Acosta
2024-09-23 11:57:39 -07:00
committed by Facebook GitHub Bot
parent 6e0e712c2a
commit 8ad4b7d0cf
@@ -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 =