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

Is there a way to turn off the zoom / size change in cropping? #75

Open
dan-lutd opened this issue Mar 8, 2022 · 2 comments
Open

Is there a way to turn off the zoom / size change in cropping? #75

dan-lutd opened this issue Mar 8, 2022 · 2 comments

Comments

@dan-lutd
Copy link

dan-lutd commented Mar 8, 2022

When cropping an image the scroll will enlarge or shrink the image.
Is it possible to turn this off?
It looks like it may be the zoomable = false or maybe :zoomable = "false" ??
perhaps in FormField.vue

<vue-cropper
     v-if="field.croppable"
         v-show="imgSrc"
         class="mb-4"
         ref='cropper'
         :view-mode="1"
         :aspect-ratio="field.aspectRatio || NaN"
         :src="imgSrc"
       >
</vue-cropper>
@ctessier
Copy link
Owner

ctessier commented Mar 8, 2022

Hi @dan-lutd,

I think you are right. By default, Cropper.js allows to zoom in or out the image using the mouse wheel or touchpad.
Check it out here and tell me if the zoomable option is what you are looking for: https://fengyuanchen.github.io/cropperjs/

If so, I guess we could make it possible to pass an array of options to the Cropper.js component.
Feel free to open a pull request. Or I will look at this when I have some time.

Thank you for your feedback.

@dan-lutd
Copy link
Author

dan-lutd commented Mar 9, 2022

Hi @ctessier , yes that is the option.
I made a fork and added :zoomable="false" for the moment,
but passings options is a better solution.
I don't know vue to even start a PR, sorry.

Thanks for this clean and friendly Nova field!

@ctessier ctessier mentioned this issue Dec 12, 2022
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants