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

Rotation using AngleRuler control does not rotate around center #24

Open
rickshane opened this issue Mar 13, 2024 · 1 comment
Open

Comments

@rickshane
Copy link

rickshane commented Mar 13, 2024

Thanks for making this awesome component available.

When I use the AngleRuler control to rotate an image, it does not seem to rotate around the image center axis, as compared to other image editing tools.

It does seem to rotate around center if the image has been zoomed in. It's just in the initial state when image fits inside the overlay that it does not rotate around the center axis.

  • Bug appears to be in Rotatable.setStraightenAngle()

Is this a bug or is this as designed?

Thanks.

@qchenqizhi
Copy link
Owner

I think this is a design, because when rotating, in addition to ensuring that rotate around the center axis, you also need to ensure that there is always image content in the cropping box (like Photos App), and crop out as little content as possible on the edges.

It also has some problems now. Like the situation you mentioned, the reason is that when calculating, there are actually many options to meet the above requirements, but the current logic will tend to choose the upper left position (rather than the most central position). ), maybe you can try to modify it and submit a PR, I think this is a more general option, and it would be better if it can be fully tested in the product delivered to users. I don't have time to do it right now

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