Uh oh!
There was an error while loading. Please reload this page.
Fix dashed/dotted border drawing when border-radius is 0 - #28359
Fix dashed/dotted border drawing when border-radius is 0#28359IjzerenHein wants to merge 1 commit into
Conversation
Base commit: 25ed045 |
facebook-github-bot
left a comment
There was a problem hiding this comment.
@shergin is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
shergin
left a comment
There was a problem hiding this comment.
Internal CI tests failed because of:
java.lang.NullPointerException: Attempt to read from field 'boolean android.graphics.Path.isSimplePath' on a null object reference
at android.graphics.BaseCanvas.drawPath(BaseCanvas.java:295)
at android.graphics.Canvas.drawPath(Canvas.java:1652)
at com.facebook.react.views.view.ReactViewBackgroundDrawable.drawRoundedBackgroundWithBorders(ReactViewBackgroundDrawable.java:338)
at com.facebook.react.views.view.ReactViewBackgroundDrawable.draw(ReactViewBackgroundDrawable.java:134)
at android.view.View.drawBackground(View.java:19399)
at android.view.View.draw(View.java:19183)
at android.view.View.draw(View.java:19062)
at android.view.ViewGroup.drawChild(ViewGroup.java:4236)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4022)
at com.facebook.react.ReactRootView.dispatchDraw(ReactRootView.java:229)
at android.view.View.draw(View.java:19060)
at android.view.ViewGroup.drawChild(ViewGroup.java:4236)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4022)
at com.facebook.react.testing.ScreenshotingFrameLayout.dispatchDraw(ScreenshotingFrameLayout.java:44)
at android.view.View.updateDisplayListIfDirty(View.java:18133)
at android.view.View.draw(View.java:18920)
at android.view.ViewGroup.drawChild(ViewGroup.java:4236)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4022)
at android.view.View.updateDisplayListIfDirty(View.java:18133)
at android.view.View.draw(View.java:18920)
at android.view.ViewGroup.drawChild(ViewGroup.java:4236)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4022)
at android.view.View.updateDisplayListIfDirty(View.java:18133)
at android.view.View.draw(View.java:18920)
at android.view.ViewGroup.drawChild(ViewGroup.java:4236)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4022)
at android.view.View.updateDisplayListIfDirty(View.java:18133)
at android.view.View.draw(View.java:18920)
at android.view.ViewGroup.drawChild(ViewGroup.java:4236)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4022)
at android.view.View.draw(View.java:19195)
at com.android.internal.policy.DecorView.draw(DecorView.java:788)
at android.view.View.updateDisplayListIfDirty(View.java:18142)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:669)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:675)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:783)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2992)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2806)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2359)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1392)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6752)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911)
at android.view.Choreographer.doCallbacks(Choreographer.java:723)
at android.view.Choreographer.doFrame(Choreographer.java:658)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
@IjzerenHein Could you please figure it out?
@shergin Which test specifically is failing? How can I run that test? When I look at the CI Android tests, they seem to fail at: And when running |
f34f6ff to
3585eefCompareanalysis-bot
commented
Apr 16, 2020
Base commit: 25ed045 |
IjzerenHein
commented
Apr 16, 2020
@shergin I've rebased on master, all tests seem to pass. I was unable to reproduce/find the issue that you mentioned. Which test did you run? |
fabOnReact
commented
Jul 8, 2020
facebook-github-bot
left a comment
There was a problem hiding this comment.
@shergin has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
facebook-github-bot
commented
Aug 12, 2021
@charlesbdudley has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
facebook-github-bot
commented
Aug 16, 2021
@charlesbdudley merged this pull request in 3e5998e. |
Hi @IjzerenHein, unfortunately this merge was reverted as it caused crashes on physical devices. Interestingly we weren't able to reproduce it in a simulator. Do you have access to a physical device to try to reproduce this error? |
IjzerenHein
commented
Sep 2, 2021
@charlesbdudley Unfortunately I don't have any bandwidth available to look at this issue :/ |
charlesbdudley
commented
Sep 7, 2021
No problem. I'm going to close this for now to focus on active PRs but feel free to mention me if your bandwidth changes and I'll open it back up! |
# Why Removes custom `BorderDrawable` class. That class was a modified version of ReactBackgroundDrawable that fixes various issues. Most of them were already fixed upstream. However, one of the fixes was reverted - react/react-native#28359, because that change was leading to crashes. # How - Removed custom `BorderDrawable` class. - Used `ReactViewBackgroundDrawable` instead. # Test Plan - bare-expo with NCL ✅
Summary
This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster
drawRectangularBackgroundWithBorderspath to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns.This PR changes the behavior to use the generic
drawRoundedBackgroundWithBorderscode-path which does support dashed/dotted border-styles.Changelog
[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0Test Plan
Faulty situation:
After the fix: