-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Open
Description
cropperjs version: 2.0.0
When I set dynamic
on cropper-selection
I can no longer drag the selection, only the image+selection together
I would like to have all these at the same time:
- dynamic zoom (on mouse wheel or zoom button click)
- translatable selection (on mouse click and drag)
- translatable image (on mouse click and drag)
Here's an example:
<cropper-canvas background>
<cropper-image rotatable scalable skewable translatable></cropper-image>
<cropper-shade hidden></cropper-shade>
<cropper-handle action="move" plain></cropper-handle>
<!-- either -->
<cropper-selection initial-coverage="0.5" movable resizable zoomable dynamic> <!-- dynamic zoom but selection not translatable-->
<!-- or -->
<cropper-selection initial-coverage="0.5" movable resizable zoomable> <!-- no dynamic zoom but selection is translatable-->
<cropper-grid role="grid" covered></cropper-grid>
<cropper-crosshair 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-selection>
</cropper-canvas>
Based on:
- Desired dynamic zoom: https://fengyuanchen.github.io/cropperjs/v2/api/cropper-selection.html#dynamic
- Desired selection translation: https://fengyuanchen.github.io/cropperjs/v2/api/cropper-selection.html#limit-boundaries
- Default template: https://github.com/fengyuanchen/cropperjs/blob/main/packages/cropperjs/src/template.ts
marcschaller
Metadata
Metadata
Assignees
Labels
No labels