Add isLandscape to orientation
This commit is contained in:
parent
08f37070a4
commit
e82f068b21
@ -8,6 +8,14 @@ enum class Orientation(override val unionValue: String) : JSUnionValue {
|
|||||||
PORTRAIT_UPSIDE_DOWN("portrait-upside-down"),
|
PORTRAIT_UPSIDE_DOWN("portrait-upside-down"),
|
||||||
LANDSCAPE_LEFT("landscape-left");
|
LANDSCAPE_LEFT("landscape-left");
|
||||||
|
|
||||||
|
fun isLandscape(): Boolean =
|
||||||
|
when (this) {
|
||||||
|
PORTRAIT -> false
|
||||||
|
PORTRAIT_UPSIDE_DOWN -> false
|
||||||
|
LANDSCAPE_LEFT -> true
|
||||||
|
LANDSCAPE_RIGHT -> true
|
||||||
|
}
|
||||||
|
|
||||||
fun toDegrees(): Int =
|
fun toDegrees(): Int =
|
||||||
when (this) {
|
when (this) {
|
||||||
PORTRAIT -> 0
|
PORTRAIT -> 0
|
||||||
|
Loading…
Reference in New Issue
Block a user