fix: iPad preview shifted left and wrongly rotated in landscape#639
Open
damianr13 wants to merge 2 commits intoApparence-io:masterfrom
Open
fix: iPad preview shifted left and wrongly rotated in landscape#639damianr13 wants to merge 2 commits intoApparence-io:masterfrom
damianr13 wants to merge 2 commits intoApparence-io:masterfrom
Conversation
Collaborator
|
Thanks a lot for your PR 🙏🏻 |
Collaborator
|
You removed SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); The problem is that we wanted to mimic the iphone normal behavior. This also can impact android |
damianr13
added a commit
to minimistapp/CameraAwesome
that referenced
this pull request
Apr 4, 2026
Reverts orientation tracking and RotatedBox rotation that caused viewport shifting on iPads. Restores setPreferredOrientations portrait lock and adds native hardening to keep AVCaptureConnection locked to portrait regardless of device motion. Addresses feedback on PR Apparence-io#639. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Reverts orientation tracking and RotatedBox rotation that caused viewport shifting on iPads. Restores setPreferredOrientations portrait lock and adds native hardening to keep AVCaptureConnection locked to portrait regardless of device motion. Addresses feedback on PR Apparence-io#639. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Author
|
Thanks for pointing that. Our users have also raised this issue since we rolled out this update. I worked on it a bit more and now the camera viewport is stable on my iPad 6 Mini. Please have a look and consider if these changes might be useful for the library Happy Easter 🐰 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #625 — Camera preview is broken on iPads:
Changes
awesome_preview_fit.dart: Add explicitwidthconstraint to the previewSizedBox. Previously onlyheightwas set, causing the preview to not be horizontally centered (shifted left on iPads).awesome_camera_preview.dart: Track device orientation viagetNativeOrientation()stream. ApplyRotatedBoxto rotate the camera texture when the device is in landscape, and swap preview dimensions so the layout engine sizes the preview correctly.MotionController.m/.h: AddonOrientationChangedcallback so the native motion controller can notify when orientation changes, enabling the Dart-side orientation tracking.camera_awesome_builder.dart: RemoveSystemChrome.setPreferredOrientations([portraitUp])fromdidChangeDependencies— this was forcing portrait-only and preventing landscape from working at all.Test plan