advanced-cropper / vue-advanced-cropper

The advanced vue cropper library that gives you opportunity to create your own croppers suited for any website design
https://advanced-cropper.github.io/vue-advanced-cropper/
Other
930 stars 128 forks source link

move-function seems not to work correct #238

Closed vollyimnetz closed 1 year ago

vollyimnetz commented 1 year ago

I tried to make buttons to move the selection by a certain amount of pixels. I had a look on the example you provided. But the example seems only to work after the zoom function has been applied. The documentation of the move-function talk about the "visible area" that is moved i guess that is the stencil. But it seems not to work.

So my question is

Bonus question 😄: how can i add keypress eventlisteners to move the stencil?

Norserium commented 1 year ago

@vollyimnetz, let's go in order.

The answers:

  1. It's not a bug.
  2. The move function moves the image, not the stencil. It will be renamed to moveImage in the future.
  3. To move the coordinates of the stencil use setCoordinates method.

The answer on the bonus question depends on the requirements. You can add event listeners to the document and call setCoordinates method appropriately.

vollyimnetz commented 1 year ago

Thank you for the quick response - i will try with setCoordinates.