aboutsummaryrefslogtreecommitdiff
path: root/src/layout.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2012-08-12 17:19:20 +0200
committerThomas White <taw@bitwiz.org.uk>2012-08-12 17:19:20 +0200
commit6d0e78aadcf111cfd82cc8762ebd43c10c7923ae (patch)
tree8d5863955735e94a54707440ff064d8509c925a1 /src/layout.c
parent3795b390e6923670d5510acc37315dc9e3668b09 (diff)
Clarify layout logic
Diffstat (limited to 'src/layout.c')
-rw-r--r--src/layout.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/layout.c b/src/layout.c
index 6bcb37c..c111e18 100644
--- a/src/layout.c
+++ b/src/layout.c
@@ -31,15 +31,13 @@
#include "presentation.h"
#include "layout.h"
-
-/* Calculate layout for frame (and all its children) based on size */
void layout_frame(struct frame *fr, double w, double h)
{
+ int i;
+
fr->w = w;
fr->h = h;
- int i;
-
for ( i=0; i<fr->num_ro; i++ ) {
struct frame *child;
@@ -49,11 +47,15 @@ void layout_frame(struct frame *fr, double w, double h)
if ( child == fr ) continue;
- child->x = fr->lop.margin_l;
- child->y = fr->lop.margin_t;
- child_w = w - (fr->lop.margin_l + fr->lop.margin_r);
- child_h = h - (fr->lop.margin_t + fr->lop.margin_b);
+ child->offs_x = child->lop.margin_l + fr->lop.pad_l;
+ child->offs_y = child->lop.margin_t + fr->lop.pad_r;
+ child_w = w - (child->lop.margin_l + child->lop.margin_r);
+ child_h = h - (child->lop.margin_t + child->lop.margin_b);
+ child_w -= (fr->lop.pad_l + fr->lop.pad_r);
+ child_h -= (fr->lop.pad_t + fr->lop.pad_b);
+
layout_frame(child, child_w, child_h);
}
}
+