v0.9.0a: fixed a rare performance bug when density is mis-reported

This commit is contained in:
Evan Debenham 2020-10-08 23:03:39 -04:00
parent ff71b997b1
commit 188f039dc7

View File

@ -41,6 +41,7 @@ import com.watabou.noosa.Gizmo;
import com.watabou.noosa.Scene;
import com.watabou.noosa.Visual;
import com.watabou.noosa.ui.Component;
import com.watabou.utils.GameMath;
import com.watabou.utils.Reflection;
import java.util.ArrayList;
@ -87,13 +88,7 @@ public class PixelScene extends Scene {
defaultZoom = SPDSettings.scale();
if (defaultZoom < Math.ceil( Game.density * 2 ) || defaultZoom > maxDefaultZoom){
defaultZoom = (int)Math.ceil( Game.density * 2.5 );
while ((
Game.width / defaultZoom < minWidth ||
Game.height / defaultZoom < minHeight
) && defaultZoom > 1) {
defaultZoom--;
}
defaultZoom = (int)GameMath.gate(2, (int)Math.ceil( Game.density * 2.5 ), maxDefaultZoom);
}
minZoom = 1;