فهرست منبع

Merge pull request #85026 from ztc0611/fix-ios-getrefreshrate

Make screen_get_refresh_rate() respect iOS Low Power Mode
Yuri Sizov 1 سال پیش
والد
کامیت
abddb93152
1فایلهای تغییر یافته به همراه5 افزوده شده و 1 حذف شده
  1. 5 1
      platform/ios/display_server_ios.mm

+ 5 - 1
platform/ios/display_server_ios.mm

@@ -443,7 +443,11 @@ int DisplayServerIOS::screen_get_dpi(int p_screen) const {
 }
 
 float DisplayServerIOS::screen_get_refresh_rate(int p_screen) const {
-	return [UIScreen mainScreen].maximumFramesPerSecond;
+	float fps = [UIScreen mainScreen].maximumFramesPerSecond;
+	if ([NSProcessInfo processInfo].lowPowerModeEnabled) {
+		fps = 60;
+	}
+	return fps;
 }
 
 float DisplayServerIOS::screen_get_scale(int p_screen) const {