Trying to get rid of the spaces where these button...
# compose-desktop
s
Trying to get rid of the spaces where these buttons meet, I made the borderstroke match the background, and made the button rectangleShape, but there is still a little bleedline or some shadow areas in between buttons where they don't perfectly meet, is it possible to remove that?
1
c
Can you show some code? What kind of button are you using? If you are using material button then I would just recommend using base button/just a box with a background with a clickable modifier.
s
Copy code
@Composable
private fun tileButton(
    isVisible: MutableState<Boolean> = mutableStateOf(false),
    turn: MutableState<Int> = mutableStateOf(0)
) = Button(
    onClick = {
        isVisible.value = true
        turn.value += 1
    },
    border = BorderStroke(0.dp, accentAmber),
    shape = RectangleShape,
    colors = ButtonDefaults.buttonColors(accentAmber),
    modifier = Modifier.size(60.dp).padding(0.dp),
) {
    Box(Modifier.drawWithContent {
        drawLine(
            color = Color.Black,
            start = Offset(center.x, -200F),
            end = Offset(center.x, 200F),
            strokeWidth = 2f,
            cap = StrokeCap.Round
        )
        drawLine(
            color = Color.Black,
            start = Offset(-200F, center.y),
            end = Offset(200F, center.y),
            strokeWidth = 2f,
            cap = StrokeCap.Round
        )
        if (isVisible.value) drawCircle(if (turn.value % 2 == 0) Color.Black else Color.White, radius = 55f)
    })
}
Yeah currently using material button. Good idea @Colton Idle, so I would just box my drawWithContent and add a clickable modifier, then I would have more control over that hopefully
c
Yeah, material design is opinionated (on purpose) and so it makes things hard to change sometimes (on purpose). In this case, this really seems like a good case to use a baseButton (if that exists. idk), or just a straight up box with clickable. Cheers
🙌 1
s
@Colton Idle Works like a charm, much obliged!
c
Fantastic. Looking forward to what you're building!