Skip to content

Commit 8ad4b7d

Browse files
jorge-cabfacebook-github-bot
authored andcommitted
Fix outline drawing 1px width when outlineWidth = 0 (facebook#46586)
Summary: Pull Request resolved: facebook#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
1 parent 6e0e712 commit 8ad4b7d

File tree

1 file changed

+4
-0
lines changed
  • packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/drawable

1 file changed

+4
-0
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/drawable/OutlineDrawable.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ internal class OutlineDrawable(
109109
((outlinePaint.alpha / 255f) / (Color.alpha(outlineColor) / 255f) * 255f).roundToInt()
110110

111111
override fun draw(canvas: Canvas) {
112+
if (outlineWidth == 0f) {
113+
return
114+
}
115+
112116
pathForOutline.reset()
113117

114118
computedBorderRadius =

0 commit comments

Comments
 (0)