fengyuanchen / cropperjs

JavaScript image cropper.
https://fengyuanchen.github.io/cropperjs/
MIT License
13.14k stars 2.42k forks source link

[V2] `cropper-selection`: `$reset()` does not take account of new initials #1165

Closed NamesMT closed 6 months ago

NamesMT commented 7 months ago

NOTE Not sure if this would be a feature request or bug.

Describe the bug Currently $reset() resets to the snapshot of the inital startup, and doesn't take account of new initial-aspect-ratio and initial-coverage

To Reproduce Steps to reproduce the behavior:

  1. Go to 'V2 Playground'
  2. Scroll down to '<cropper-selection> part'
  3. Change the initial-aspect-ratio, initial-coverage
  4. (optional): Move the current selection to a new coordinate
  5. Click on '$reset()'
  6. Observe behavior

Expected behavior The selection should be reset with the initials data setting taken into account.

fengyuanchen commented 6 months ago

It's fixed and will be released in the next version.