From 0c8799f4dd378f81610f0fef7793aaf759d36930 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 23 Apr 2025 12:50:44 -0400 Subject: [PATCH] Favor more utilization of bottom screenshot row When we have the grid size, cut off any extra columns so long as it doesn't gain a row. --- confluent_client/bin/nodeconsole | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/confluent_client/bin/nodeconsole b/confluent_client/bin/nodeconsole index 83e071ad..02c00e81 100755 --- a/confluent_client/bin/nodeconsole +++ b/confluent_client/bin/nodeconsole @@ -152,6 +152,13 @@ def determine_tile_size(numnodes): elif deviation < bestdeviation: bestdeviation = deviation bestdims = [columns, rows] + # ok, the above algorithm can still pick things like + # 1 2 3 + # 4 + # So we will let it pick the number of rows, and + # then see if we can chop columns and still fit + while (bestdims[0] - 1) * bestdims[1] >= numnodes: + bestdims[0] = bestdims[0] - 1 cellswide = cwidth // bestdims[0] cellshigh = cheight // bestdims[1] tilewidth = cellswide * pixwidth / cwidth