列表表格垫空白(80行)让 pref ≥ ScrollPane 视口:列表区域铺满红框,内容多时照常滚动

This commit is contained in:
tianmo committed 2026-10-16 17:24:23 +08:00
1 parent 949d741cde
commit d6a766d5b4
1 file changed
+9
@@ -642,6 +642,15 @@ public final class ObjectPanel {
private static void beginRender(State state) throws Exception {
call(state.listTable, Obf.TABLE_CLEAR_CHILDREN, new Class<?>[0], void.class);
state.logBlockStarted = false;
// 给列表内容垫一段空白:让列表表格的 pref 高度不小于 ScrollPane 视口,
// 这样它就会铺满红框(内容少时也不会缩成一小块),内容多时照常滚动。
StringBuilder blank = new StringBuilder();
for (int i = 0; i < 80; i++) blank.append('\n');
Class<?> cellClass = Class.forName(Obf.CELL, true, state.loader);
Class<?> actorClass = Class.forName(Obf.ACTOR, true, state.loader);
call(state.listTable, Obf.TABLE_ADD, new Class<?>[] {actorClass}, cellClass,
label(state.loader, state.skin, blank.toString()));
call(state.listTable, Obf.TABLE_ROW, new Class<?>[0], cellClass);
}
/**