mirror of
https://github.com/swaywm/sway.git
synced 2024-11-26 18:01:29 +00:00
resize set: add assertion for an invalid unit
This commit is contained in:
parent
a7b9e63cbc
commit
f9bde0030d
|
@ -524,7 +524,9 @@ static struct cmd_results *resize_set_floating(struct sway_container *con,
|
||||||
grow_width = width->amount - con->width;
|
grow_width = width->amount - con->width;
|
||||||
con->x -= grow_width / 2;
|
con->x -= grow_width / 2;
|
||||||
con->width = width->amount;
|
con->width = width->amount;
|
||||||
|
break;
|
||||||
case RESIZE_UNIT_INVALID:
|
case RESIZE_UNIT_INVALID:
|
||||||
|
sway_assert(false, "invalid width unit");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -542,7 +544,9 @@ static struct cmd_results *resize_set_floating(struct sway_container *con,
|
||||||
grow_height = height->amount - con->height;
|
grow_height = height->amount - con->height;
|
||||||
con->y -= grow_height / 2;
|
con->y -= grow_height / 2;
|
||||||
con->height = height->amount;
|
con->height = height->amount;
|
||||||
|
break;
|
||||||
case RESIZE_UNIT_INVALID:
|
case RESIZE_UNIT_INVALID:
|
||||||
|
sway_assert(false, "invalid height unit");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue