On Android 9 I have a strange artefact where `Colu...
# compose
d
On Android 9 I have a strange artefact where
Column(modifier = Modifier.alpha(0.9f)) { Surface(elevation = 16.dp) }
is drawing drastically different shadow + gets clipped — compared to
alpha(1f)
. None of this happens on other SDK versions. Is this some known/reported bug?
1
k
Screenshot?
d
This is after applying a very small alpha diff 1f -> 0.9f or something like this
notice the shadow rendering change and also the clipping. on non 28 API this doesnt happen: no clipping and the change is barely noticable
a
go ahead and file an issue to get an official ruling
👌 1
d
Managed to create a "minimal" example which shows that shadow direction seems to shift for some reason right after applying alpha < 1f. and clipping starts to occur. Issues is incoming 🙂
a
Depending on where the shadow projection surface is I would expect clipping to occur. When you ask content to be translucent, you're asking the system to render that content to an off screen buffer and then render the pixels in that buffer with transparency. That buffer has a finite size and anything outside of it isn't just clipped, it has nowhere to be stored and redrawn.
What surprises me is the platform version dependence of the behavior
d
I see. Alpha clipping is explained then. But on API 28 shadow also changes direction. Here are the videos on API 27 and API 28.