jetpack撰写画布blendMode不起作用

时间:2020-10-04 14:39:54

标签: android canvas android-jetpack-compose blend-mode

我想在Src的背景下显示一些矩形,但是它总是显示全部

Canvas(modifier = Modifier.height(40.dp).fillMaxWidth(.7f)) {
    drawRect(Color.Gray, size = Size(this.size.width, this.size.height)
        , blendMode = BlendMode.Src
    )
    drawRoundRect(Color.Red, size = Size(120f, 60f)
        , radius = Radius(30F, 30F)
        , blendMode = BlendMode.SrcIn
    )
}

Composable Preview

0 个答案:

没有答案