15m5 成书根治稀疏: 封页贪心fill85满屏+中间孤短页合并130+CR方块修复(去\r)
Auto Release / build (push) Successful in 3m51s

This commit is contained in:
youpaishidifu
2026-11-23 10:25:21 +08:00
parent d9035a6abc
commit 4b1e890a08
@@ -394,15 +394,9 @@ public class CustomScreenManager implements Listener {
// 封页只填 20 字孤稀。改贪心 fill 直接取前 85 字(残句续下一页),封页满屏。
// 正文页仍用 findSemanticCut 语义切(不劈词)。
if (!body.isEmpty()) {
// 15m4 封页往前扫: 从0往85找最后一个语义边界(句末/逗号/换行), 取最靠后, 避免劈词
// 15m4 封页贪心 fill 85: 残句续第2页, 封页满屏不稀疏
// (往前扫遇长段早停23字孤稀, 改贪心满屏; 末字劈词可接受, 残句续下页玩家能读懂)
int cut = Math.min(body.length(), 85);
for (int ci = cut; ci >= 0; ci--) {
char cc = body.charAt(ci);
if (cc == '。' || cc == '!' || cc == '?' || cc == ';' || cc == ',' || cc == ',' || cc == '\n') {
cut = ci + 1;
break;
}
}
pages.add(body.substring(0, cut));
body = body.substring(cut);
@@ -495,7 +489,7 @@ public class CustomScreenManager implements Listener {
for (int pi = 1; pi + 1 < pages.size(); pi++) {
String cur = pages.get(pi);
String nxt = pages.get(pi + 1);
if (cur.length() < 40 && (cur.length() + nxt.length() + 1) <= 105) {
if (cur.length() < 50 && (cur.length() + nxt.length() + 1) <= 130) {
pages.set(pi + 1, cur + "\n" + nxt);
pages.remove(pi);
}