mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 13:03:36 +00:00
[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 <kirylkaveryn@gmail.com>
This commit is contained in:
committed by
Yannik Bloscheck
parent
2eccbba26e
commit
056711f4bd
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user