1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Update the editor display scale based on the device's scaled density

This commit is contained in:
Fredia Huya-Kouadio
2022-04-04 02:22:51 -07:00
parent 10d9e47949
commit 8eabf77f54
8 changed files with 44 additions and 2 deletions

View File

@@ -222,10 +222,14 @@ public class GodotIO {
}
public int getScreenDPI() {
DisplayMetrics metrics = activity.getApplicationContext().getResources().getDisplayMetrics();
DisplayMetrics metrics = activity.getResources().getDisplayMetrics();
return (int)(metrics.density * 160f);
}
public float getScaledDensity() {
return activity.getResources().getDisplayMetrics().scaledDensity;
}
public double getScreenRefreshRate(double fallback) {
Display display = activity.getWindowManager().getDefaultDisplay();
if (display != null) {