Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when cropping rotated area, it crops different area #10

Closed
ddulhddul opened this issue Jun 12, 2023 · 0 comments
Closed

when cropping rotated area, it crops different area #10

ddulhddul opened this issue Jun 12, 2023 · 0 comments

Comments

@ddulhddul
Copy link
Contributor

ddulhddul commented Jun 12, 2023

Thanks for gif cropperjs lib it helps me a lot in my project,
but I found an issue about rotated area crop.

after cropper.rotate(-45),
cropped blob area is not matched with canvas

I think this is cause of setupCanvas function's rotated box check

    var rotatedBoxWidth = (this.width*Math.cos(radian)+this.height*Math.sin(radian)) * limitRatio;
    var rotatedBoxHeight = (this.height*Math.cos(radian)+this.width*Math.sin(radian)) * limitRatio;

var rotatedBoxWidth = (this.widthMath.cos(radian)+this.heightMath.sin(radian)) * limitRatio;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants