forked from organicmaps/organicmaps
[iPhone] Viewport is saved between program terminations
This commit is contained in:
parent
16cf51569c
commit
a5ad666142
3 changed files with 20 additions and 1 deletions
|
@ -40,4 +40,7 @@ withConfidenceRadius: (double) confidenceRadius
|
|||
- (void) onResize: (GLint)width withHeight: (GLint)height;
|
||||
- (void) onPaint;
|
||||
|
||||
// called when app is terminated by system
|
||||
- (void) OnTerminate;
|
||||
|
||||
@end
|
||||
|
|
|
@ -74,7 +74,10 @@ typedef FrameWork<model::FeaturesFetcher, Navigator, iphone::WindowHandle> frame
|
|||
|
||||
// to perform a proper resize
|
||||
[(EAGLView*)self.view layoutSubviews];
|
||||
m_framework->ShowAll();
|
||||
|
||||
// restore previous screen position
|
||||
if (!m_framework->LoadState())
|
||||
m_framework->ShowAll();
|
||||
}
|
||||
|
||||
return self;
|
||||
|
@ -295,4 +298,12 @@ NSInteger compareAddress(UITouch * l, UITouch * r, void * context)
|
|||
m_framework->SetOrientation(newOrientation);
|
||||
}
|
||||
|
||||
- (void) OnTerminate
|
||||
{
|
||||
if (m_framework)
|
||||
{ // save world rect for next launch
|
||||
m_framework->SaveState();
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -6,6 +6,11 @@
|
|||
@synthesize window;
|
||||
@synthesize mapViewController;
|
||||
|
||||
// here we're
|
||||
- (void) applicationWillTerminate: (UIApplication *) application
|
||||
{
|
||||
[mapViewController OnTerminate];
|
||||
}
|
||||
|
||||
- (void) applicationDidFinishLaunching: (UIApplication *) application
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue