summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2020-01-03 17:41:08 -0800
committerVito Caputo <vcaputo@pengaru.com>2020-01-03 17:41:08 -0800
commit3ae1e53ac08887a0e8209499aee4daade9c5ea8e (patch)
treefe21dbf677bbce8345737205f7de9d0e7c1499a9 /src/modules
parent2731cd376a982a21c793896a5ed6c0df2b65fb41 (diff)
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.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/montage/montage.c4
1 files changed, 2 insertions, 2 deletions
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,
© All Rights Reserved