Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content Drawn can cross boundary of the declared modifier #50

Open
sai1153 opened this issue Sep 2, 2023 · 3 comments
Open

Content Drawn can cross boundary of the declared modifier #50

sai1153 opened this issue Sep 2, 2023 · 3 comments

Comments

@sai1153
Copy link

sai1153 commented Sep 2, 2023

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

@lumec
Copy link

lumec commented Nov 3, 2023

Same here

@cvetojevichbojan
Copy link

cvetojevichbojan commented Nov 22, 2023

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()** ....)

}

@JustKhit
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants