More backwards compatible version of PR
This commit is contained in:
parent
be57dcb659
commit
22cae6189c
|
@ -109,12 +109,26 @@ void *glkitview_init(void);
|
||||||
|
|
||||||
- (void)viewWillLayoutSubviews
|
- (void)viewWillLayoutSubviews
|
||||||
{
|
{
|
||||||
|
float width = 0.0f, height = 0.0f, tenpctw, tenpcth;
|
||||||
|
RAScreen *screen = (RAScreen*)get_chosen_screen();
|
||||||
UIInterfaceOrientation orientation = self.interfaceOrientation;
|
UIInterfaceOrientation orientation = self.interfaceOrientation;
|
||||||
CGRect screenSize = [[UIScreen mainScreen] bounds];
|
CGRect screenSize = [[UIScreen mainScreen] bounds];
|
||||||
float width = ((int)orientation < 3) ? CGRectGetWidth(screenSize) : CGRectGetHeight(screenSize);
|
SEL selector = NSSelectorFromString(BOXSTRING("coordinateSpace"));
|
||||||
float height = ((int)orientation < 3) ? CGRectGetHeight(screenSize) : CGRectGetWidth(screenSize);
|
|
||||||
float tenpctw = width / 10.0f;
|
if ([screen respondsToSelector:selector])
|
||||||
float tenpcth = height / 10.0f;
|
{
|
||||||
|
screenSize = [[screen coordinateSpace] bounds];
|
||||||
|
width = CGRectGetWidth(screenSize);
|
||||||
|
height = CGRectGetHeight(screenSize);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
width = ((int)orientation < 3) ? CGRectGetWidth(screenSize) : CGRectGetHeight(screenSize);
|
||||||
|
height = ((int)orientation < 3) ? CGRectGetHeight(screenSize) : CGRectGetWidth(screenSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
tenpctw = width / 10.0f;
|
||||||
|
tenpcth = height / 10.0f;
|
||||||
|
|
||||||
g_pause_indicator_view.frame = CGRectMake(tenpctw * 4.0f, 0.0f, tenpctw * 2.0f, tenpcth);
|
g_pause_indicator_view.frame = CGRectMake(tenpctw * 4.0f, 0.0f, tenpctw * 2.0f, tenpcth);
|
||||||
[g_pause_indicator_view viewWithTag:1].frame = CGRectMake(0, 0, tenpctw * 2.0f, tenpcth);
|
[g_pause_indicator_view viewWithTag:1].frame = CGRectMake(0, 0, tenpctw * 2.0f, tenpcth);
|
||||||
|
|
Loading…
Reference in New Issue