From 056711f4bd485cbff8f5e264678c1f280d459b0a Mon Sep 17 00:00:00 2001 From: Kiryl Kaveryn Date: Mon, 15 Sep 2025 18:10:31 +0400 Subject: [PATCH] [ios] Update the visual scale with the current screen's value on switch to phone When the app was not running and launched from the Carplay, the main_visualScale was initialized with CP scale (usually it is 2). Then, when the user switches to the phone this incorrect values can be used in `UpdateVisualScale`. The current screen's scale should be used instead in the `updateVisualScaleToMain` without intermediated values. Signed-off-by: Kiryl Kaveryn --- iphone/Maps/Classes/EAGLView.mm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/iphone/Maps/Classes/EAGLView.mm b/iphone/Maps/Classes/EAGLView.mm index c681bd86d..77958f63e 100644 --- a/iphone/Maps/Classes/EAGLView.mm +++ b/iphone/Maps/Classes/EAGLView.mm @@ -32,7 +32,6 @@ namespace dp // It's possible when we add/remove subviews (bookmark balloons) and it hangs the map without this check CGRect m_lastViewSize; bool m_presentAvailable; - double main_visualScale; } @property(nonatomic, readwrite) BOOL graphicContextInitialized; @end @@ -221,13 +220,14 @@ double getExactDPI(double contentScaleFactor) return _widgetsManager; } -- (void)updateVisualScaleTo:(CGFloat)visualScale { - main_visualScale = df::VisualParams::Instance().GetVisualScale(); +- (void)updateVisualScaleTo:(CGFloat)visualScale +{ GetFramework().UpdateVisualScale(visualScale); } -- (void)updateVisualScaleToMain { - GetFramework().UpdateVisualScale(main_visualScale); +- (void)updateVisualScaleToMain +{ + GetFramework().UpdateVisualScale(UIScreen.mainScreen.scale); } @end