[iOS] fix wrong map viewport

This commit is contained in:
Aleksey Belouosv 2019-11-05 17:47:35 +03:00 committed by Alexander Boriskov
parent 476b5f05b4
commit fa6dcb2f4b
2 changed files with 4 additions and 4 deletions

View file

@ -15,7 +15,7 @@ final class VisibleArea: AvailableArea {
return
}
}
FrameworkHelper.setVisibleViewport(areaFrame, scaleFactor: contentScaleFactor)
FrameworkHelper.setVisibleViewport(areaFrame, scaleFactor: MapViewController.shared()?.mapView.contentScaleFactor ?? 1)
}
}

View file

@ -123,7 +123,7 @@ final class CarPlayMapViewController: MWMViewController {
frame.origin = origin
frame.size = CGSize(width: viewBounds.width - origin.x,
height: viewBounds.height - origin.y)
FrameworkHelper.setVisibleViewport(frame, scaleFactor: view.contentScaleFactor)
FrameworkHelper.setVisibleViewport(frame, scaleFactor: mapView?.contentScaleFactor ?? 1)
}
private func updateVisibleViewPortToNavigationState() {
@ -136,11 +136,11 @@ final class CarPlayMapViewController: MWMViewController {
frame.origin = origin
frame.size = CGSize(width: viewBounds.width - (origin.x + mapControlsWidth),
height: viewBounds.height - origin.y)
FrameworkHelper.setVisibleViewport(frame, scaleFactor: view.contentScaleFactor)
FrameworkHelper.setVisibleViewport(frame, scaleFactor: mapView?.contentScaleFactor ?? 1)
}
private func updateVisibleViewPortToDefaultState() {
FrameworkHelper.setVisibleViewport(view.bounds, scaleFactor: view.contentScaleFactor)
FrameworkHelper.setVisibleViewport(view.bounds, scaleFactor: mapView?.contentScaleFactor ?? 1)
}
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {