-
-
Notifications
You must be signed in to change notification settings - Fork 239
fix: fix the UI jumping issue when rotateCropBoxFor90DegreeRotation = false #490
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
base: master
Are you sure you want to change the base?
Conversation
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
📝 WalkthroughWalkthroughThe changes address crop box resizing instability after 90-degree rotation by refactoring frame confinement logic in CropView and adding animation control to the image containment method. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used🧠 Learnings (2)📓 Common learnings📚 Learning: 2025-06-19T08:13:01.113ZApplied to files:
🧬 Code graph analysis (1)Sources/Mantis/CropView/CropView.swift (4)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a UI jumping issue that occurs during 90-degree rotation when the rotateCropBoxFor90DegreeRotation configuration is set to false. The fix simplifies coordinate calculations and ensures proper image containment without animation during rotation.
- Simplified touch point confinement logic by removing redundant frame and content offset calculations
- Added animation control to the
makeSureImageContainsCropOverlaymethod with backward-compatible default - Ensured the crop overlay is properly contained after rotation adjustments when not rotating the crop box
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| Sources/Mantis/CropView/CropView.swift | Simplified touch point calculation, added animation control parameter, and fixed rotation jump by ensuring image contains crop overlay without animation |
| Example/DemoViewController.swift | Added commented-out configuration line for testing the rotateCropBoxFor90DegreeRotation = false scenario |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Fixes #486
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.