DrawBox
DrawBox copied to clipboard
Content Drawn can cross boundary of the declared modifier
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
Same here
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()** ....)
}
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