File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
android/src/main/java/app/capgo/capacitor/camera/preview Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -2759,7 +2759,8 @@ public void flipCamera() {
27592759 // Determine current position based on session config and flip it
27602760 String currentPosition = sessionConfig .getPosition ();
27612761 String newPosition = "front" .equals (currentPosition ) ? "rear" : "front" ;
2762-
2762+ // Maintain centered config
2763+ boolean wasCentered = sessionConfig .isCentered ();
27632764 Log .d (TAG , "flipCamera: Switching from " + currentPosition + " to " + newPosition );
27642765
27652766 sessionConfig = new CameraSessionConfiguration (
@@ -2782,6 +2783,8 @@ public void flipCamera() {
27822783 sessionConfig .isVideoModeEnabled () // enableVideoMode
27832784 );
27842785
2786+ sessionConfig .setCentered (wasCentered );
2787+
27852788 // Clear current device ID to force position-based selection
27862789 currentDeviceId = null ;
27872790
You can’t perform that action at this time.
0 commit comments