From a93deaa2a7194a18ff2ae35d5137188eeae9c2b5 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 24 Oct 2018 05:12:00 -0400 Subject: [PATCH] v0.7.0a: reverted screen distortion adjustments as they caused more issues than they fixed. Will try again for 0.7.0b --- .../ShatteredPixelDungeon.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java index ad4f6c2bc..e0da595d2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java @@ -22,7 +22,6 @@ package com.shatteredpixel.shatteredpixeldungeon; import android.content.pm.ActivityInfo; -import android.content.res.Configuration; import android.os.Build; import android.os.Bundle; import android.view.View; @@ -252,13 +251,6 @@ public class ShatteredPixelDungeon extends Game { updateDisplaySize(); } - - @Override - public void onConfigurationChanged(Configuration newConfig) { - super.onConfigurationChanged(newConfig); - - updateDisplaySize(); - } public void updateDisplaySize(){ boolean landscape = SPDSettings.landscape(); @@ -275,8 +267,11 @@ public class ShatteredPixelDungeon extends Game { } } - dispHeight = getWindow().getWindowManager().getDefaultDisplay().getHeight(); - dispWidth = getWindow().getWindowManager().getDefaultDisplay().getWidth(); + if (view.getMeasuredWidth() == 0 || view.getMeasuredHeight() == 0) + return; + + dispWidth = view.getMeasuredWidth(); + dispHeight = view.getMeasuredHeight(); float dispRatio = dispWidth / (float)dispHeight;