mirror of
https://github.com/Genymobile/scrcpy
synced 2025-08-31 14:25:56 +00:00
Move empty string test for crop option parsing
For consistency with other options.
This commit is contained in:
@@ -256,7 +256,9 @@ public class Options {
|
|||||||
options.tunnelForward = Boolean.parseBoolean(value);
|
options.tunnelForward = Boolean.parseBoolean(value);
|
||||||
break;
|
break;
|
||||||
case "crop":
|
case "crop":
|
||||||
|
if (!value.isEmpty()) {
|
||||||
options.crop = parseCrop(value);
|
options.crop = parseCrop(value);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case "control":
|
case "control":
|
||||||
options.control = Boolean.parseBoolean(value);
|
options.control = Boolean.parseBoolean(value);
|
||||||
@@ -337,9 +339,6 @@ public class Options {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static Rect parseCrop(String crop) {
|
private static Rect parseCrop(String crop) {
|
||||||
if (crop.isEmpty()) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
// input format: "width:height:x:y"
|
// input format: "width:height:x:y"
|
||||||
String[] tokens = crop.split(":");
|
String[] tokens = crop.split(":");
|
||||||
if (tokens.length != 4) {
|
if (tokens.length != 4) {
|
||||||
|
Reference in New Issue
Block a user