Rotating any view 180 degrees causes shadow to disappear completely
See original GitHub issueHello,
I know I am fighting against a massive corporation, but I have tried my best to get at least someone that works with Skia/MaterialComponents to fix this annoying issue which has destroyed my codebase.
I am working on a paint app, and in this app, the user has the option to rotate the canvas, this feature can be useful in some scenarios.
The problem I am having, is that when I rotate the MaterialCardView
, which hosts the canvas/bitmap, 180 degrees – the drop shadow (card elevation) disappears. I do not get this problem when I rotate the MaterialCardView
any angle but 180 degrees, only 180 degrees.
Below are some examples:
0 degrees:
180 degrees:
My app is greatly suffering because of this bug as I’ve had to resort to quite frankly terrible workarounds – such as setting the rotation as 179.9
.
Upon doing more research I discovered that this issue was reported twice in IssueTracker:
https://issuetracker.google.com/issues/173730323
https://issuetracker.google.com/issues/137454913
To my shock, it was marked as resolved.
This issue is NOT resolved in Android at least, and is easily reproducible when creating a new project in Android Studio Dolphin. With all due respect, it’s just absolutely insane that this bug still exists, and I have had to deal with at least 5 bugs because of the workaround that someone helped me come up with. I also have to delay the release of my next app’s version because of all the bugs because of this issue.
My codebase is also greatly suffering because of the workaround. It’s almost as if you guys don’t care about developers and are just sweeping this issue under the rug. Release after release after release and absolutely no comment in regards to this issue.
Can you please patch this bug?
Issue Analytics
- State:
- Created a year ago
- Comments:8 (2 by maintainers)
Top GitHub Comments
That might be the case, but in general for 180 degrees there always is the workaround I said. It’s a more or less rare case that a view with elevation has to be rotated 180 degrees in my opinion and it would be unnecessarily much internal work on shadow rendering or rendering in general only to fix this rare case.
Just pack your views inside of a FrameView and rotate this FrameView instead of the container CardView, then you no longer have any issues.