react-advanced-cropper icon indicating copy to clipboard operation
react-advanced-cropper copied to clipboard

Is it possible to set the stencil coordinates?

Open Ananthumpillai opened this issue 1 year ago • 4 comments

I have two input text field for entering desired height and width, can stencil be placed according to that value.

Ananthumpillai avatar Feb 21 '24 06:02 Ananthumpillai

@Ananthumpillai, yes, of course, you can set the coordinates programatically.

Norserium avatar Feb 21 '24 06:02 Norserium

sample.webm

I want something like this According to my height and width stencil has to relocate @Norserium

Ananthumpillai avatar Feb 21 '24 06:02 Ananthumpillai

@Ananthumpillai, I don't get, you can set the coordinates also. For example:

const resize(width, height) => {
    if (cropperRef.current) {
        cropperRef.current.setCoordinates(({ coordinates }) => {
            width: width,
            height: height,
            left: (coordinates.left + coordinates.width / 2) - width / 2,
            top: (coordinates.top + coordinates.height / 2) - height / 2
        })
    }
};

Norserium avatar Feb 26 '24 12:02 Norserium

@Ananthumpillai, any news?

Norserium avatar Jun 09 '24 17:06 Norserium