Seeing some weird behavior with `graphicsLayer` + ...
# compose
t
Seeing some weird behavior with 
graphicsLayer
 + 
shadowElevation
 🧵 (using rc01)
there seem to be some artifacts visible near the shadow (see bottom-left/top-left/right:
Relevant code
Not sure if this is a bug, known or otherwise, or if its incorrect usage of the api
a
why do you set a shadow twice? Once with graphicsLayer() and another one with shadow(). Which one of those two gives this effect?
t
Sorry, that was a copy paste error. The
.shadow()
modifier just creates a feathered shadow around the
Box
. The
shadowElevation
in
graphicsLayer
is what produces the skewed shadow + artifacts, regardless of the
.shadow()
modifier
a
what if you try to split one graphicsLayer into two separate once, where one defines the rotation and another one the shadow?
t
that seems to work:
Copy code
Box(
            modifier = Modifier
                .wrapContentSize()
                .graphicsLayer {
                    rotationX = /** **/
                    rotationY = /** **/
                    cameraDistance = /** **/
                }
                .graphicsLayer {
                    shadowElevation = elevation
                    shape = RoundedCornerShape(6.dp)
                },
        )
wondering why/how this separation works... 🤔 is this how the API is supposed to be used for this use case?
a
feel free to file a bug, we would explore is something can be improved on our side
👍🏼 1
t
thank you, will do!