Compose-Cropper icon indicating copy to clipboard operation
Compose-Cropper copied to clipboard

how to change crop zone from code?

Open asenanov7 opened this issue 1 year ago • 2 comments

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

asenanov7 avatar Feb 08 '24 08:02 asenanov7

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

SmartToolFactory avatar Feb 08 '24 14:02 SmartToolFactory

can you please ping me when you release a new version

asenanov7 avatar Feb 09 '24 08:02 asenanov7