fix: fix the UI jumping issue when rotateCropBoxFor90DegreeRotation = false#490
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.
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.