From edf71da1c37d0bf77add75e845f21a42c51a4253 Mon Sep 17 00:00:00 2001 From: Miodec Date: Mon, 25 Nov 2024 12:53:12 +0100 Subject: fix: custom mode limit breaking show all lines in some cases #6072 --- frontend/src/ts/test/test-ui.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/frontend/src/ts/test/test-ui.ts b/frontend/src/ts/test/test-ui.ts index ec28d660a..25a0f9ee0 100644 --- a/frontend/src/ts/test/test-ui.ts +++ b/frontend/src/ts/test/test-ui.ts @@ -497,12 +497,18 @@ function updateWordsHeight(force = false): void { const wordsHeight = $( document.querySelector("#words") as Element ).outerHeight(true) as number; - if ( - Config.showAllLines && - Config.mode !== "time" && - CustomText.getLimitMode() !== "time" && - CustomText.getLimitValue() !== 0 - ) { + + const shouldLimitToThreeLines = + Config.mode === "time" || + (Config.mode === "custom" && CustomText.getLimitMode() === "time") || + (Config.mode === "custom" && + CustomText.getLimitMode() === "word" && + CustomText.getLimitValue() === 0) || + (Config.mode === "custom" && + CustomText.getLimitMode() === "section" && + CustomText.getLimitValue() === 0); + + if (Config.showAllLines && !shouldLimitToThreeLines) { // overflow-x should not be visible in tape mode, but since showAllLines can't // be enabled simultaneously with tape mode we don't need to check it's off $("#words") -- cgit v1.2.3