Skip to content

Instantly share code, notes, and snippets.

@GRizzi91
Created October 13, 2021 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GRizzi91/d9256243e973240514fe4e654872e6fe to your computer and use it in GitHub Desktop.
Save GRizzi91/d9256243e973240514fe4e654872e6fe to your computer and use it in GitHub Desktop.
@Preview
@Composable
fun DrawSquare() {
Canvas(
modifier = Modifier
.height(100.dp)
.width(200.dp)
) {
drawRect(
color = Color.Red,
size = Size(width = size.height, height = size.height),
topLeft = Offset(x = 0f, y = 0f)
)
drawRect(
color = Color.Red,
size = Size(width = size.height, height = size.height),
topLeft = Offset(x = size.height, y = 0f)
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment