v1.1.2: added inset support for notched iPhones in landscape

This commit is contained in:
Evan Debenham
2022-01-06 12:06:52 -05:00
parent 16f3774a1a
commit cc221bc089
10 changed files with 64 additions and 25 deletions

View File

@@ -71,4 +71,13 @@ public class DeviceCompat {
Gdx.app.log( tag, message );
}
public static RectF getSafeInsets(){
RectF result = new RectF();
result.left = Gdx.graphics.getSafeInsetLeft();
result.top = Gdx.graphics.getSafeInsetTop();
result.right = Gdx.graphics.getSafeInsetRight();
result.bottom = Gdx.graphics.getSafeInsetBottom();
return result;
}
}

View File

@@ -148,6 +148,10 @@ public class Rect {
return shrink( 1 );
}
public Rect scale( int d ){
return new Rect( left * d, top * d, right * d, bottom * d );
}
public ArrayList<Point> getPoints() {
ArrayList<Point> points = new ArrayList<>();
for (int i = left; i <= right; i++)

View File

@@ -143,5 +143,9 @@ public class RectF {
public RectF shrink() {
return shrink( 1 );
}
public RectF scale( float d ){
return new RectF( left * d, top * d, right * d, bottom * d );
}
}