forked from organicmaps/organicmaps
[iOS] Fixed recovering from background in landscape mode
This commit is contained in:
parent
8d945dd0d1
commit
43acfe9cdb
5 changed files with 11 additions and 8 deletions
|
@ -24,6 +24,8 @@ namespace dp
|
|||
|
||||
@property (nonatomic, readonly) BOOL drapeEngineCreated;
|
||||
|
||||
@property (nonatomic, readonly) m2::PointU pixelSize;
|
||||
|
||||
- (void)deallocateNative;
|
||||
- (CGPoint)viewPoint2GlobalPoint:(CGPoint)pt;
|
||||
- (CGPoint)globalPoint2ViewPoint:(CGPoint)pt;
|
||||
|
|
|
@ -117,6 +117,14 @@ double getExactDPI(double contentScaleFactor)
|
|||
});
|
||||
}
|
||||
|
||||
- (m2::PointU)pixelSize
|
||||
{
|
||||
CGSize const s = self.bounds.size;
|
||||
uint32_t const w = static_cast<uint32_t>(s.width * self.contentScaleFactor);
|
||||
uint32_t const h = static_cast<uint32_t>(s.height * self.contentScaleFactor);
|
||||
return m2::PointU(w, h);
|
||||
}
|
||||
|
||||
- (void)onSize:(int)width withHeight:(int)height
|
||||
{
|
||||
int w = width * self.contentScaleFactor;
|
||||
|
|
|
@ -675,7 +675,7 @@ using namespace osm_auth_ios;
|
|||
// because of new OpenGL driver powered by Metal.
|
||||
if ([AppInfo sharedInfo].isMetalDriver)
|
||||
{
|
||||
m2::PointU size = GetFramework().GetViewportPixelSize();
|
||||
m2::PointU const size = ((EAGLView *)self.mapViewController.view).pixelSize;
|
||||
GetFramework().OnRecoverGLContext(static_cast<int>(size.x), static_cast<int>(size.y));
|
||||
}
|
||||
[MWMLocationManager applicationDidBecomeActive];
|
||||
|
|
|
@ -1051,12 +1051,6 @@ m2::PointD Framework::GetPixelCenter() const
|
|||
: m_currentModelView.PixelRect().Center();
|
||||
}
|
||||
|
||||
m2::PointU Framework::GetViewportPixelSize() const
|
||||
{
|
||||
auto & rect = m_currentModelView.PixelRect();
|
||||
return m2::PointU(static_cast<uint32_t>(rect.SizeX()), static_cast<uint32_t>(rect.SizeY()));
|
||||
}
|
||||
|
||||
m2::PointD Framework::GetVisiblePixelCenter() const
|
||||
{
|
||||
return m_visibleViewport.Center();
|
||||
|
|
|
@ -563,7 +563,6 @@ public:
|
|||
|
||||
m2::PointD GetPixelCenter() const;
|
||||
m2::PointD GetVisiblePixelCenter() const;
|
||||
m2::PointU GetViewportPixelSize() const;
|
||||
|
||||
m2::PointD const & GetViewportCenter() const;
|
||||
void SetViewportCenter(m2::PointD const & pt);
|
||||
|
|
Loading…
Add table
Reference in a new issue