Afzal Najam

    Afzal Najam

    1 year ago
    Is the opacity of the
    drawShadow
    modifier supposed to change the opacity of the whole Box? Changing the
    0.3f
    opacity changes the opacity of the whole box and its contents. Simplified example:
    @Composable
    private fun StrangeButton() {
        Box(
            modifier = Modifier.then(
                Modifier.drawShadow(
                    elevation = 4.dp,
                    opacity = 0.3f
                )
            ).then(
                Modifier.background(
                    color = Color.Green
                )
            )
        ) {
            Image(
                asset = Icons.Default.Person,
                colorFilter = ColorFilter.tint(Color.White)
            )
        }
    }
    Zach Klippenstein (he/him) [MOD]

    Zach Klippenstein (he/him) [MOD]

    1 year ago
    Pretty sure it's not, I'd file a bug
    FYI you can write your modifiers more concisely:
    Modifier
      .drawShadow(…)
      .background(…)
    Afzal Najam

    Afzal Najam

    1 year ago
    Done: https://issuetracker.google.com/issues/171624638 Thanks for that tip @Zach Klippenstein (he/him) [MOD]!