prevent empty pages from being produced (#615)

This commit is contained in:
Glease authored and GitHub committed 2025-03-25 15:06:45 +01:00
1 parent 4f60928b61
commit 64a747e4bd
1 file changed
+2 -1
@@ -746,8 +746,9 @@ public class GuiContainerManager {
GuiDraw.ITooltipLineHandler line = GuiDraw.getTipLine(text);
int lineHeight = line != null ? line.getSize().height
: text.endsWith(GuiDraw.TOOLTIP_LINESPACE) && i + 1 < list.size() ? 12 : 10;
if (height + lineHeight <= GuiDraw.displaySize().height - 8 * 2 - 10) {
if (height + lineHeight <= GuiDraw.displaySize().height - 8 * 2 - 10 || tmp.isEmpty()) {
// top & bottom 8px + last line for showing page
// and at least include one line per page
height += lineHeight;
} else {
ret.add(new ArrayList<>(tmp));