v1.1.2: added inset support for notched iPhones in landscape
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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++)
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user