diff --git a/iphone/Maps/UI/CarPlay/CarPlayMapViewController.swift b/iphone/Maps/UI/CarPlay/CarPlayMapViewController.swift index 2146d2c60..fb01ee0e6 100644 --- a/iphone/Maps/UI/CarPlay/CarPlayMapViewController.swift +++ b/iphone/Maps/UI/CarPlay/CarPlayMapViewController.swift @@ -173,28 +173,11 @@ final class CarPlayMapViewController: MWMViewController { } private func updateVisibleViewPortToPreviewState() { - let viewBounds = view.bounds - let previewWidth = self.view.frame.width * 0.45 - let navigationHeight: CGFloat = 45.0 - var frame = CGRect.zero - let origin = isLeftWheelCar ? CGPoint(x: previewWidth, y: navigationHeight) : CGPoint(x: 0, y: navigationHeight) - frame.origin = origin - frame.size = CGSize(width: viewBounds.width - origin.x, - height: viewBounds.height - origin.y) - updateVisibleViewPort(frame: frame) + updateVisibleViewPort(frame: view.frame.inset(by: view.safeAreaInsets)) } private func updateVisibleViewPortToNavigationState() { - let viewBounds = view.bounds - let previewWidth = viewBounds.width * 0.45 - let mapControlsWidth = viewBounds.width * 0.15 - let navigationHeight: CGFloat = 45.0 - var frame = CGRect.zero - let origin = isLeftWheelCar ? CGPoint(x: previewWidth, y: navigationHeight) : CGPoint(x: 0, y: navigationHeight) - frame.origin = origin - frame.size = CGSize(width: viewBounds.width - (origin.x + mapControlsWidth), - height: viewBounds.height - origin.y) - updateVisibleViewPort(frame: frame) + updateVisibleViewPort(frame: view.frame.inset(by: view.safeAreaInsets)) } private func updateVisibleViewPortToDefaultState() {