From 2287683f8d624baaa56a143d2151b73465121679 Mon Sep 17 00:00:00 2001 From: minjaesong Date: Tue, 22 Jun 2021 22:05:49 +0900 Subject: [PATCH] resolving potential infinite loop --- assets/bios/wp.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/bios/wp.js b/assets/bios/wp.js index 244a4ee..efb63f9 100644 --- a/assets/bios/wp.js +++ b/assets/bios/wp.js @@ -36,7 +36,7 @@ const TYPESET_STRATEGY_JUSTIFIED = 3 // not implemented yet! const typesetStrats = [undefined, undefined, typesetLessRagged, typesetJustified] let PAGE_HEIGHT = 60 -let PAGE_WIDTH = 80 +let PAGE_WIDTH = 80 // minimum possible value is 3 // 80x60 -> 720x1080 text area; with 72px margin for each side, paper resolution is 864x1224, which is quite close to 1:sqrt(2) ratio let scroll = 0 @@ -374,7 +374,7 @@ function typesetJustified(lineStart, lineEnd) { } } // expand spaces - else if (!isLineEnd && justLen < paintWidth) { + else if (recDepth < 5 && !isLineEnd && justLen < paintWidth) { printdbg("EXPAND SPACES BETWEEN") let expandTargets = normalSpc.shuffle().concat(spcAfterPunct.shuffle())