DrawBox icon indicating copy to clipboard operation
DrawBox copied to clipboard

Content Drawn can cross boundary of the declared modifier

Open sai1153 opened this issue 2 years ago • 3 comments

WhatsApp Image 2023-09-03 at 12 11 35 AM

i think it can be avoided by adding a if condition in updateLatestPath(newPoint) function which checks whether the point lies inside the given modifier, if it lies inside then only add the newPoint

sai1153 avatar Sep 02 '23 18:09 sai1153

Same here

lumec avatar Nov 03 '23 13:11 lumec

Try adding clipToBounds to your modifier DrawBox modifier:

Box(
            modifier = Modifier
                .padding(top = 8.dp)
                .fillMaxSize(0.75f)
                .border(width = 1.dp, color = Color.DarkGray)
        ) {

DrawBox(drawController = controller, modifier = Modifier.fillMaxSize().**clipToBounds()** ....)

}

cvetojevichbojan avatar Nov 22 '23 11:11 cvetojevichbojan

Try adding clipToBounds to your modifier DrawBox modifier:

Box(
            modifier = Modifier
                .padding(top = 8.dp)
                .fillMaxSize(0.75f)
                .border(width = 1.dp, color = Color.DarkGray)
        ) {

DrawBox(drawController = controller, modifier = Modifier.fillMaxSize().**clipToBounds()** ....)

}

Awesome. Thanks

JustKhit avatar Apr 22 '24 20:04 JustKhit