aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/resize.c
diff options
context:
space:
mode:
authorLibravatar Konstantin Pospelov <kupospelov@gmail.com>2018-11-25 15:16:45 +0300
committerLibravatar Konstantin Pospelov <kupospelov@gmail.com>2018-11-25 15:16:45 +0300
commitf9bde0030dd12d1afd8dd6378f099944727561cf (patch)
treea77609c2170379af08df3de0a35b506f653ed58a /sway/commands/resize.c
parentresize set: fix units for floating containers (diff)
downloadsway-f9bde0030dd12d1afd8dd6378f099944727561cf.tar.gz
sway-f9bde0030dd12d1afd8dd6378f099944727561cf.tar.zst
sway-f9bde0030dd12d1afd8dd6378f099944727561cf.zip
resize set: add assertion for an invalid unit
Diffstat (limited to 'sway/commands/resize.c')
-rw-r--r--sway/commands/resize.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sway/commands/resize.c b/sway/commands/resize.c
index bafaea87..cf5dea02 100644
--- a/sway/commands/resize.c
+++ b/sway/commands/resize.c
@@ -524,7 +524,9 @@ static struct cmd_results *resize_set_floating(struct sway_container *con,
524 grow_width = width->amount - con->width; 524 grow_width = width->amount - con->width;
525 con->x -= grow_width / 2; 525 con->x -= grow_width / 2;
526 con->width = width->amount; 526 con->width = width->amount;
527 break;
527 case RESIZE_UNIT_INVALID: 528 case RESIZE_UNIT_INVALID:
529 sway_assert(false, "invalid width unit");
528 break; 530 break;
529 } 531 }
530 } 532 }
@@ -542,7 +544,9 @@ static struct cmd_results *resize_set_floating(struct sway_container *con,
542 grow_height = height->amount - con->height; 544 grow_height = height->amount - con->height;
543 con->y -= grow_height / 2; 545 con->y -= grow_height / 2;
544 con->height = height->amount; 546 con->height = height->amount;
547 break;
545 case RESIZE_UNIT_INVALID: 548 case RESIZE_UNIT_INVALID:
549 sway_assert(false, "invalid height unit");
546 break; 550 break;
547 } 551 }
548 } 552 }