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

how to change crop zone from code? #41

Open
asenanov7 opened this issue Feb 8, 2024 · 2 comments
Open

how to change crop zone from code? #41

asenanov7 opened this issue Feb 8, 2024 · 2 comments

Comments

@asenanov7
Copy link

I'm using Slider from 0 to 100, and wanted to be able to give the user the ability to adjust the cropping area using it

@SmartToolFactory
Copy link
Owner

You can change overlayRatio like this

    var value by remember {
        mutableStateOf(0f)
    }

    val cropProperties by remember(value) {
        mutableStateOf(
            CropDefaults.properties(
                cropOutlineProperty = CropOutlineProperty(
                    OutlineType.Rect,
                    RectCropShape(0, "Rect")
                ),
                handleSize = handleSize,
                overlayRatio = value
            )
        )
    }

But as you mentioned on stackoverflow it will play animation. I can add a flag to disable that animation after changing overlay in the futurer

@asenanov7
Copy link
Author

can you please ping me when you release a new version

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

2 participants