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
|
// It's possible when we add/remove subviews (bookmark balloons) and it hangs the map without this check
|
||||||
CGRect m_lastViewSize;
|
CGRect m_lastViewSize;
|
||||||
bool m_presentAvailable;
|
bool m_presentAvailable;
|
||||||
double main_visualScale;
|
|
||||||
}
|
}
|
||||||
@property(nonatomic, readwrite) BOOL graphicContextInitialized;
|
@property(nonatomic, readwrite) BOOL graphicContextInitialized;
|
||||||
@end
|
@end
|
||||||
@@ -221,13 +220,14 @@ double getExactDPI(double contentScaleFactor)
|
|||||||
return _widgetsManager;
|
return _widgetsManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)updateVisualScaleTo:(CGFloat)visualScale {
|
- (void)updateVisualScaleTo:(CGFloat)visualScale
|
||||||
main_visualScale = df::VisualParams::Instance().GetVisualScale();
|
{
|
||||||
GetFramework().UpdateVisualScale(visualScale);
|
GetFramework().UpdateVisualScale(visualScale);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)updateVisualScaleToMain {
|
- (void)updateVisualScaleToMain
|
||||||
GetFramework().UpdateVisualScale(main_visualScale);
|
{
|
||||||
|
GetFramework().UpdateVisualScale(UIScreen.mainScreen.scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
Reference in New Issue
Block a user