mirror of https://github.com/Genymobile/scrcpy
Use up-to-date values on display fold change
When a display is folded or unfolded, the maxSize may have been updated since the option was passed, and deviceSize must be updated. Refs #4469 <https://github.com/Genymobile/scrcpy/pull/4469>
This commit is contained in:
parent
1beec99f82
commit
c9a4d2b38f
|
@ -45,11 +45,11 @@ public final class Device {
|
||||||
void onClipboardTextChanged(String text);
|
void onClipboardTextChanged(String text);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final Size deviceSize;
|
|
||||||
private final Rect crop;
|
private final Rect crop;
|
||||||
private int maxSize;
|
private int maxSize;
|
||||||
private final int lockVideoOrientation;
|
private final int lockVideoOrientation;
|
||||||
|
|
||||||
|
private Size deviceSize;
|
||||||
private ScreenInfo screenInfo;
|
private ScreenInfo screenInfo;
|
||||||
private RotationListener rotationListener;
|
private RotationListener rotationListener;
|
||||||
private FoldListener foldListener;
|
private FoldListener foldListener;
|
||||||
|
@ -116,8 +116,8 @@ public final class Device {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
screenInfo = ScreenInfo.computeScreenInfo(displayInfo.getRotation(), displayInfo.getSize(), options.getCrop(),
|
deviceSize = displayInfo.getSize();
|
||||||
options.getMaxSize(), options.getLockVideoOrientation());
|
screenInfo = ScreenInfo.computeScreenInfo(displayInfo.getRotation(), deviceSize, crop, maxSize, lockVideoOrientation);
|
||||||
// notify
|
// notify
|
||||||
if (foldListener != null) {
|
if (foldListener != null) {
|
||||||
foldListener.onFoldChanged(displayId, folded);
|
foldListener.onFoldChanged(displayId, folded);
|
||||||
|
|
Loading…
Reference in New Issue