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

stencilSize prop no longer available to set fixed size of stencil #73

Open
martin-omacht opened this issue Aug 8, 2024 · 2 comments
Open

Comments

@martin-omacht
Copy link

Hi, I'm using version 0.20.0 and seems that the stencilSize prop that is used in this example https://advanced-cropper.github.io/react-advanced-cropper/docs/guides/advanced-recipes#fixed-stencil is no longer available and I cannot figure out how to set a fixed size for the stencil. I am trying to make the stencil always full size of the cropper container, but it seems that without this prop I can zoom out the image as much as I want and it will also make the stencil smaller instead of restricting the zoom of the image. And once I zoom it out and the stencil zooms out with it, I cannot return the stencil to it's initial size as when I zoom back in, the stencil stays does not zoom in with together with the image. Could you update the example to reflect current API or am I missing something?

Here's a code of my cropper:

<Cropper
  src={image}
  defaultSize={({ imageSize }) => ({
    width: imageSize.width,
    height: imageSize.height,
  })}
  stencilComponent={CircleStencil}
  stencilProps={{ grid: true, handlers: false, resizable: false, lines: false, movable: false }}
  imageRestriction={ImageRestriction.stencil}
/>
@maliuta-oleksandr
Copy link

Up

@maliuta-oleksandr
Copy link

defaultCoordinates work

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