Animesh Sahu
11/13/2020, 2:01 PMval shape = GenericShape { size ->
moveTo(size.width / 2f, 0f)
lineTo(size.width, size.height)
lineTo(0f, size.height)
}
After copy pasting the triangle shape (which I'm going to change later), I don't have idea of how to draw it.
Shape seems to be a parameter of Modifier.border
, Modifier.drawLayer
, so I tried, but nothing works 😛 :
fun main() =
Window(
title = "Compose for Desktop",
size = IntSize(300, 300),
) {
DesktopMaterialTheme(
colors = lightColors(background = Color.Cyan),
) {
Box(modifier = Modifier.border(5.dp, Color.Cyan, shape))
}
}
Any thoughts?Andrey Kulikov
11/13/2020, 4:57 PMModifier.background