react-mobile-cropper icon indicating copy to clipboard operation
react-mobile-cropper copied to clipboard

Understanding (left, top) coordinates after rotation

Open tmb5cg opened this issue 2 years ago • 1 comments

Sorry if this is a dumb question, but I can't for the life of me understand the coordinate system after rotation. It works great without any rotation, and is standard top left (X, Y) positioning (or left, top).

Also library is great and props to you for making it.

Moving the crop size/coordinates works great via left, top, width and height. But upon rotation, I do not understand why the (left, top) coordinate changes. It doesn't appear to be the location of the top left corner, nor the center of the image.

Is there something I'm missing in the documentation or anything someone can point me to for more context? Thanks in advance

tmb5cg avatar Mar 21 '23 20:03 tmb5cg

@tmb5cg, it's not a dumb question at all.

There is the peculiarity, that the coordinates are relative to the bounding box of an image. croppper-01

That's the most straightforward and rational approach, that can be easily implemented on the backend by the way. In an other case we need to deal with the coordinates of the rotated rectangle inside the another rectangle.

Norserium avatar Mar 22 '23 06:03 Norserium