diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-11-17 11:04:34 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-17 11:04:34 -0500 |
commit | eda3bfeed5097c71634332bfe998188b028abf02 (patch) | |
tree | a5fb241142cf6815a8fce76eb9b5faf101d69ff9 /sway/commands/resize.c | |
parent | Merge pull request #3143 from colemickens/grow (diff) | |
parent | Move view {x,y,width,height} into container struct (diff) | |
download | sway-eda3bfeed5097c71634332bfe998188b028abf02.tar.gz sway-eda3bfeed5097c71634332bfe998188b028abf02.tar.zst sway-eda3bfeed5097c71634332bfe998188b028abf02.zip |
Merge pull request #3142 from RyanDwyer/move-view-properties
Move view {x,y,width,height} into container struct
Diffstat (limited to 'sway/commands/resize.c')
-rw-r--r-- | sway/commands/resize.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/sway/commands/resize.c b/sway/commands/resize.c index dc4e8000..a90d578e 100644 --- a/sway/commands/resize.c +++ b/sway/commands/resize.c | |||
@@ -404,13 +404,10 @@ static struct cmd_results *resize_adjust_floating(enum resize_axis axis, | |||
404 | con->width += grow_width; | 404 | con->width += grow_width; |
405 | con->height += grow_height; | 405 | con->height += grow_height; |
406 | 406 | ||
407 | if (con->view) { | 407 | con->content_x += grow_x; |
408 | struct sway_view *view = con->view; | 408 | con->content_y += grow_y; |
409 | view->x += grow_x; | 409 | con->content_width += grow_width; |
410 | view->y += grow_y; | 410 | con->content_height += grow_height; |
411 | view->width += grow_width; | ||
412 | view->height += grow_height; | ||
413 | } | ||
414 | 411 | ||
415 | arrange_container(con); | 412 | arrange_container(con); |
416 | 413 | ||
@@ -546,13 +543,10 @@ static struct cmd_results *resize_set_floating(struct sway_container *con, | |||
546 | } | 543 | } |
547 | } | 544 | } |
548 | 545 | ||
549 | if (con->view) { | 546 | con->content_x -= grow_width / 2; |
550 | struct sway_view *view = con->view; | 547 | con->content_y -= grow_height / 2; |
551 | view->x -= grow_width / 2; | 548 | con->content_width += grow_width; |
552 | view->y -= grow_height / 2; | 549 | con->content_height += grow_height; |
553 | view->width += grow_width; | ||
554 | view->height += grow_height; | ||
555 | } | ||
556 | 550 | ||
557 | arrange_container(con); | 551 | arrange_container(con); |
558 | 552 | ||