summaryrefslogtreecommitdiff
path: root/sway/layout.c
diff options
context:
space:
mode:
authortaiyu <[email protected]>2015-08-20 04:57:01 -0700
committertaiyu <[email protected]>2015-08-20 04:57:01 -0700
commitf6e002fb8b664d80ef10126f6a204ffbb2f192df (patch)
tree32fae9211bd6df4c4ecfd501703faedf83c14477 /sway/layout.c
parentb76dcf6e0fb9cec1bc966b5a4ab764cd9c61bd48 (diff)
small fix, default width/height 0
Diffstat (limited to 'sway/layout.c')
-rw-r--r--sway/layout.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sway/layout.c b/sway/layout.c
index 6a4f8b45..192f09cf 100644
--- a/sway/layout.c
+++ b/sway/layout.c
@@ -194,7 +194,7 @@ void arrange_windows(swayc_t *container, int width, int height) {
//Calculate total width
for (i = 0; i < container->children->length; ++i) {
int *old_width = &((swayc_t *)container->children->items[i])->width;
- if (*old_width == 0) {
+ if (*old_width <= 0) {
if (container->children->length > 1) {
*old_width = width / (container->children->length - 1);
} else {
@@ -221,12 +221,12 @@ void arrange_windows(swayc_t *container, int width, int height) {
//Calculate total height
for (i = 0; i < container->children->length; ++i) {
int *old_height = &((swayc_t *)container->children->items[i])->height;
+ if (*old_height <= 0) {
if (container->children->length > 1) {
*old_height = height / (container->children->length - 1);
} else {
*old_height = height;
}
- if (*old_height == 0) {
}
scale += *old_height;
}