Skip to content

Commit

Permalink
Simplify virtual display video size
Browse files Browse the repository at this point in the history
Do not use an unnecessary intermediate Rect object.

PR #5370 <#5370>
  • Loading branch information
rom1v committed Oct 28, 2024
1 parent 12d5ca4 commit 5851b62
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ public void start(Surface surface) {
}

try {
Rect videoRect = screenInfo.getVideoSize().toRect();
Size videoSize = screenInfo.getVideoSize();
virtualDisplay = ServiceManager.getDisplayManager()
.createVirtualDisplay("scrcpy", videoRect.width(), videoRect.height(), displayId, surface);
.createVirtualDisplay("scrcpy", videoSize.getWidth(), videoSize.getHeight(), displayId, surface);
Ln.d("Display: using DisplayManager API");
} catch (Exception displayManagerException) {
try {
Expand Down

0 comments on commit 5851b62

Please sign in to comment.