From cce512b7252ff7fd3f1329f224407fb772c9b4aa Mon Sep 17 00:00:00 2001 From: Arslaan Pathan Date: Tue, 21 Apr 2026 18:11:23 +1200 Subject: A bunch of more layout work --- src/saffron_layout.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/saffron_layout.c') diff --git a/src/saffron_layout.c b/src/saffron_layout.c index cc91246..c714bfa 100644 --- a/src/saffron_layout.c +++ b/src/saffron_layout.c @@ -23,4 +23,19 @@ SaffronBox* saffron_box_new(SaffronOrientation orientation, SaffronHorizontalAli return box; } +void saffron_box_layout(SaffronBox* box) { + if (!box || ((SaffronWidget*)box)->child_count == 0) return; + int content_x = ((SaffronWidget*)box)->x + box->margin; + int content_y = ((SaffronWidget*)box)->y + box->margin; + int content_w = ((SaffronWidget*)box)->w - (box->margin * 2); + int content_h = ((SaffronWidget*)box)->h - (box->margin * 2); + + int inner_x = content_x + box->padding; + int inner_y = content_y + box->padding; + int inner_w = content_w - (box->padding * 2); + int inner_h = content_h - (box->padding * 2); + + /* TODO actually make it layout */ + return; +} -- cgit v1.2.3