From 3ae1e53ac08887a0e8209499aee4daade9c5ea8e Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Fri, 3 Jan 2020 17:41:08 -0800 Subject: montage: bump Y tiles when root has large fraction Ideally the number of modules can tile without leaving gaps, but as rototiller evolves over time modules are added piecemeal so try accomodate those awkward layouts. --- src/modules/montage/montage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/modules') diff --git a/src/modules/montage/montage.c b/src/modules/montage/montage.c index ce29d61..f064e5c 100644 --- a/src/modules/montage/montage.c +++ b/src/modules/montage/montage.c @@ -159,8 +159,8 @@ static int montage_fragmenter(void *context, const fb_fragment_t *fragment, unsi { montage_context_t *ctxt = context; float root = sqrtf(ctxt->n_modules); - unsigned tile_width = fragment->frame_width / ceilf(root); /* screens are wide, give excess to the width */ - unsigned tile_height = fragment->frame_height / floorf(root); /* take from the height */ + unsigned tile_width = fragment->frame_width / ceilf(root); /* screens are wide, always give excess to the width */ + unsigned tile_height = fragment->frame_height / rintf(root); /* only give to the height when fraction is >= .5f */ int ret; /* XXX: this could all be more clever and make some tiles bigger than others to deal with fractional square roots, -- cgit v1.2.3