v1.2.0: added a failsafe for linux sometimes reporting infinite density
This commit is contained in:
parent
1370ae35f1
commit
41dc5c90af
|
@ -93,6 +93,9 @@ public class Game implements ApplicationListener {
|
|||
@Override
|
||||
public void create() {
|
||||
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;
|
||||
dispWidth = Gdx.graphics.getDisplayMode().width;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user