Croppie icon indicating copy to clipboard operation
Croppie copied to clipboard

I'd like to have some more documentation on bind --> points parameters

Open richard-naud opened this issue 7 years ago • 4 comments

Following documentation on https://foliotek.github.io/Croppie/ --> "points Array of points that translate into [topLeftX, topLeftY, bottomRightX, bottomRightY] "

I try to figure out what all this mean... topLeftX of what? Of the image regarding boundary? Or vice-versa? Can I have a drawing explaining that topic which could help to have a better understanding?

Thank Richard

richard-naud avatar Feb 16 '18 02:02 richard-naud

Ok, after few tests, I think I might catch it... It looks like to be the coordinates (e.g. topLeftX) of the image inside the boundary. The boundary acts as a cartesian system, with 0,0 located on bottom left of the boundary.

richard-naud avatar Feb 16 '18 02:02 richard-naud

I don't get it... how can I center a file with that system?

monkeymonk avatar Jul 04 '19 12:07 monkeymonk

@monkeymonk Croppie automatically tries to center the image when you bind to it. You can see the code here: https://github.com/Foliotek/Croppie/blob/master/croppie.js#L1130

thedustinsmith avatar Jul 05 '19 14:07 thedustinsmith

It appears that left,top,width,height are relate to the bound image. boundary, viewport & zoom appear to be applied afterward

grumpygary avatar Apr 21 '23 16:04 grumpygary