-
Notifications
You must be signed in to change notification settings - Fork 28.6k
[web]: BoxDecoration border doesn't render if borderRadius is set #37772
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Checking |
The problem is that drawDRRect checks if the inner rectangle (in this case, the inner side of the border) is contained within the outer rectangle (the outer side of the border), here. It seems the check above is not correct, since it's not taking into account inner's radius when checking, so DRRects that have a "thin" border width compared to its border radius (less than ~1/3rd, on circular radii) will fail the check (and not render the border). (For reference, this is the implementation of RRect.contains, which does take into account the normalized border radius to compute if a point is contained within the rrect) |
The inner part is computed by calling .deflate on the outer part (by the width of the border). Deflate just substracts from both the coordinates of the rectangle, and its corner radius. I'm going to try a fix by changing the |
… outer on RecordingCanvas (#12229) * Improve check to determine if a rrect is fully contained within another in RecordingCanvas. * Add unit tests. Fixes flutter/flutter#37772 (and others)
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
If borderRadius is set within the Container BoxDecoration then it overwrites a border in the same BoxDecoration.
The code above is wrapped in a Row in the new flutter_web boiler plate.
In Chrome it looks like:

if I comment out the borderRadius, then in chrome I get:
The border seems to be being over written by the borderRadius in flutter_web.
The same code (as the first code block) on Android, produces this:
Chrome Version: Version 76.0.3809.100 (Official Build) (64-bit)
Webdev Version: 2.3.0
Command: flutter pub global run webdev serve --launch-in-chrome --auto refresh
Flutter_Web:
The text was updated successfully, but these errors were encountered: