15m8 成书封页根治'劈在句末/标题': 满屏贪心但避开孤短句末切点(<55字退化硬切100)
Auto Release / build (push) Successful in 3m40s

This commit is contained in:
youpaishidifu
2026-11-23 12:28:19 +08:00
parent 01538b570b
commit 7305d7d9eb
@@ -394,10 +394,19 @@ public class CustomScreenManager implements Listener {
// 封页只填 20 字孤稀。改贪心 fill 直接取前 85 字(残句续下一页),封页满屏。
// 正文页仍用 findSemanticCut 语义切(不劈词)。
if (!body.isEmpty()) {
// 15m7 封页贪心 fill 100: 95→100 一次加5(用户节奏: 一点点加, 慢慢找合适大小)
// 封页切点固定=此字数, 调大=封页往正文后面多写一点
int cut = Math.min(body.length(), 100);
// 15m8 封页根治"劈在句末/标题": 满屏贪心但避开孤短句末切点。
// 从100往回扫句末标点(。!?;\n), 若切点<55字(孤短, 如"所有玩家一律平等;")
// 则退化硬切100(残句续下页, 玩家能读懂), 封页不孤稀也不劈标题。
int coverLimit = 100;
int best = -1;
for (int i = Math.min(body.length() - 1, coverLimit); i >= 0; i--) {
char c = body.charAt(i);
if (c == '。' || c == '!' || c == '?' || c == ';' || c == '\n') {
best = i + 1;
break;
}
}
int cut = (best < 55) ? Math.min(body.length(), coverLimit) : Math.min(body.length(), best);
pages.add(body.substring(0, cut));
body = body.substring(cut);
}