fengyuanchen/cropperjs

v2: Selection area doesn't pass zoom events down to image

Closed this issue · 4 comments

a0s commented

Describe the bug
So, i have this template:

<cropper-canvas background>
  <cropper-image  rotatable scalable skewable slottable translatable></cropper-image>
  <cropper-handle action="move" plain></cropper-handle>
  <cropper-selection movable resizable precise>
    <cropper-grid role="grid" bordered covered></cropper-grid>
    <cropper-crosshair theme-color="rgba(238, 238, 238, 0.5)" centered></cropper-crosshair>
    <cropper-handle action="move" theme-color="rgba(255, 255, 255, 0.35)"></cropper-handle>
    <cropper-handle action="n-resize"></cropper-handle>
    <cropper-handle action="e-resize"></cropper-handle>
    <cropper-handle action="s-resize"></cropper-handle>
    <cropper-handle action="w-resize"></cropper-handle>
    <cropper-handle action="ne-resize"></cropper-handle>
    <cropper-handle action="nw-resize"></cropper-handle>
    <cropper-handle action="se-resize"></cropper-handle>
    <cropper-handle action="sw-resize"></cropper-handle>
  </cropper-selectioninitialCoverage>
</cropper-canvas>

I disabled zoomable for selection area because i don't need it. But what i want to have is ability to zoom image with scroll event. Now its working at outside of selection area only. Imagine that by default the selection is stretched over the entire container - in this case zoom will not work at all. How to fix it? It need to pass scroll events to image through selection area transparently.

Versions
"cropperjs": "^2.0.0-rc.0",

a0s commented

Thank you, works good

Hello,
Thank for your job.
It's possible to create new release with this fix (ex. 2.0.0-rc.1) ?

The v2.0.0-rc.1 has been released.

Hello,
For me, doesn't work on move selector, but working on zoom contexte.
Capture vidéo du 13-07-2024 14:49:03.webm