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

Fully fledged flip implementation #597

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Janneman84
Copy link

I'm working on some new features and improvements, including a decent flip implementation.

While working on this I noticed some issues with the photo tending to slightly shift and jump after the rotate animation and cropping. You'll need to zoom in the photo a bit first to see this. My flip implementation had similar issues.

I noticed the code literary has dozens of floors, ceils and a few integer downcasts. I realized this probably was the cause of these issues. So I decided to just remove them all. Then I added pixel rounding where necessary, rounding to the nearest physical pixel (not point).

Doing this fixed all the issues I was experiencing, creating a more smooth and precise experience.

I have few other tweaks and fixes lined up as well, which I'd like to propose after this.

@Janneman84
Copy link
Author

Turns out CGFloat and NSTimeInterval are both doubles these days. I'll make the necessary changes.

…ariants, because CGFloat and NSTimeInterval are actually doubles.
@Janneman84
Copy link
Author

Janneman84 commented Oct 26, 2024

Ok I got rid of all of the float stuff, it's all doubles now :P

@Janneman84 Janneman84 changed the title More accurate cropping and rotating by using a different rounding strategy Fully fledged flip implementation Nov 17, 2024
@Janneman84
Copy link
Author

I included my fully fledged flip implementation:

99mpg0

For this I added two extra buttons. The vertical flip button is hidden by default. I changed the order of the buttons to make more sense. I replaced all pre-iOS13 buttons with images for consistency.

I had to update the delegate methods/callbacks with an extra 'flipped' argument. The old delegate methods still work for compatibility. In order to motivate developers to update I made it so fresh builds (less than 2 hours old) will crash when opening the cropper, telling you to update the delegate methods. So once released it won't crash anymore.

I have a bunch more tweaks and fixes in the works if you're interested.

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

Successfully merging this pull request may close these issues.

1 participant