v1.2.0: added a failsafe for linux sometimes reporting infinite density
This commit is contained in:
@@ -93,6 +93,9 @@ public class Game implements ApplicationListener {
|
|||||||
@Override
|
@Override
|
||||||
public void create() {
|
public void create() {
|
||||||
density = Gdx.graphics.getDensity();
|
density = Gdx.graphics.getDensity();
|
||||||
|
if (density == Float.POSITIVE_INFINITY){
|
||||||
|
density = 100f / 160f; //assume 100PPI if density can't be found
|
||||||
|
}
|
||||||
dispHeight = Gdx.graphics.getDisplayMode().height;
|
dispHeight = Gdx.graphics.getDisplayMode().height;
|
||||||
dispWidth = Gdx.graphics.getDisplayMode().width;
|
dispWidth = Gdx.graphics.getDisplayMode().width;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user