mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-05 04:03:49 +01:00
Increase the safe inset margins slightly
This commit is contained in:
1 parent
45ef8120f3
commit
052e21b903
4 files changed
+24
-9
No files matched your search
@@ -1349,6 +1349,7 @@ elseif(IOS AND NOT LIBRETRO)
|
||||
ios/Controls.h
|
||||
ios/Controls.mm
|
||||
ios/ViewControllerCommon.h
|
||||
ios/ViewControllerCommon.mm
|
||||
ios/ViewController.mm
|
||||
ios/ViewController.h
|
||||
ios/ViewControllerMetal.mm
|
||||
|
||||
+6
-6
@@ -108,13 +108,13 @@ bool InitController(GCController *controller) {
|
||||
};
|
||||
}
|
||||
|
||||
#if defined(__IPHONE_14_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_14_0
|
||||
if ([extendedProfile respondsToSelector:@selector(buttonHome)] && extendedProfile.buttonHome != nil) {
|
||||
extendedProfile.buttonHome.valueChangedHandler = ^(GCControllerButtonInput *button, float value, BOOL pressed) {
|
||||
controllerButtonPressed(pressed, NKCODE_HOME);
|
||||
};
|
||||
if (@available(iOS 14.0, *)) {
|
||||
if ([extendedProfile respondsToSelector:@selector(buttonHome)] && extendedProfile.buttonHome != nil) {
|
||||
extendedProfile.buttonHome.valueChangedHandler = ^(GCControllerButtonInput *button, float value, BOOL pressed) {
|
||||
controllerButtonPressed(pressed, NKCODE_HOME);
|
||||
};
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
extendedProfile.leftThumbstick.xAxis.valueChangedHandler = ^(GCControllerAxisInput *axis, float value) {
|
||||
AxisInput axisInput;
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
#import "ios/ViewControllerCommon.h"
|
||||
|
||||
@@ -491,13 +491,25 @@ extern float g_safeInsetRight;
|
||||
extern float g_safeInsetTop;
|
||||
extern float g_safeInsetBottom;
|
||||
|
||||
static float BoostInset(float inset) {
|
||||
if (inset > 0.0f) {
|
||||
// If there's some inset, add a few pixels extra. Really needed on iPhone 12, at least.
|
||||
inset += 4.0f;
|
||||
}
|
||||
return inset;
|
||||
}
|
||||
|
||||
- (void)viewSafeAreaInsetsDidChange {
|
||||
if (@available(iOS 11.0, *)) {
|
||||
[super viewSafeAreaInsetsDidChange];
|
||||
// we use 0.0f instead of safeAreaInsets.bottom because the bottom overlay isn't disturbing (for now)
|
||||
g_safeInsetLeft = self.view.safeAreaInsets.left;
|
||||
g_safeInsetRight = self.view.safeAreaInsets.right;
|
||||
g_safeInsetTop = self.view.safeAreaInsets.top;
|
||||
g_safeInsetLeft = BoostInset(self.view.safeAreaInsets.left);
|
||||
g_safeInsetRight = BoostInset(self.view.safeAreaInsets.right);
|
||||
g_safeInsetTop = BoostInset(self.view.safeAreaInsets.top);
|
||||
|
||||
// TODO: In portrait mode, should probably use safeAreaInsets.bottom.
|
||||
// However, in landscape mode, it's not really needed.
|
||||
// g_safeInsetBottom = BoostInset(self.view.safeAreaInsets.bottom);
|
||||
g_safeInsetBottom = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user