Fix default locked capture orientation

The default landscape locked orientation was reversed.

Fixes #6010 <https://github.com/Genymobile/scrcpy/issues/6010>
This commit is contained in:
Romain Vimont 2025-04-24 16:12:28 +02:00
commit 48f38c4bb6

View file

@ -32,9 +32,11 @@ public enum Orientation {
throw new IllegalArgumentException("Unknown orientation: " + name); throw new IllegalArgumentException("Unknown orientation: " + name);
} }
public static Orientation fromRotation(int rotation) { public static Orientation fromRotation(int ccwRotation) {
assert rotation >= 0 && rotation < 4; assert ccwRotation >= 0 && ccwRotation < 4;
return values()[rotation]; // Display rotation is expressed counter-clockwise, orientation is expressed clockwise
int cwRotation = (4 - ccwRotation) % 4;
return values()[cwRotation];
} }
public boolean isFlipped() { public boolean isFlipped() {