Allow margin:false as a shortcut for no margins

This commit is contained in:
Sebastián Katzer
2019-02-12 12:44:33 +01:00
parent 6b4972918e
commit 82ba5c4a59
3 changed files with 10 additions and 6 deletions

View File

@@ -89,6 +89,7 @@ class PrintOptions {
@NonNull PrintAttributes toPrintAttributes()
{
PrintAttributes.Builder builder = new PrintAttributes.Builder();
Object margin = spec.opt("margin");
switch (spec.optString("orientation"))
{
@@ -112,7 +113,7 @@ class PrintOptions {
}
}
if (!spec.optBoolean("border", true))
if (margin instanceof Boolean && !((Boolean) margin))
{
builder.setMinMargins(NO_MARGINS);
}