2
0
mirror of https://github.com/Genymobile/scrcpy synced 2025-08-30 13:58:08 +00:00

Move empty string test for crop option parsing

For consistency with other options.
This commit is contained in:
Romain Vimont 2023-10-26 22:42:46 +02:00
parent 76a99a7fcd
commit b7ad652a75

View File

@ -256,7 +256,9 @@ public class Options {
options.tunnelForward = Boolean.parseBoolean(value);
break;
case "crop":
options.crop = parseCrop(value);
if (!value.isEmpty()) {
options.crop = parseCrop(value);
}
break;
case "control":
options.control = Boolean.parseBoolean(value);
@ -337,9 +339,6 @@ public class Options {
}
private static Rect parseCrop(String crop) {
if (crop.isEmpty()) {
return null;
}
// input format: "width:height:x:y"
String[] tokens = crop.split(":");
if (tokens.length != 4) {