- F-018: per-frame text-width re-measure in 9 GUI foreground layers plus the HUD TipMessage width loop; boundary with magnitude arithmetic and the cache-at-initGui fix path - exclusion face: F8 guard-in-place (vanilla 64-block TE render cap, never overridden), F9/F10/F12/F14 zero form, F11 design body (fixed small counts on gameplay events), F15 startup-time icon registration - F-005 same-shape note (TileRendererCreativeNode), F-016 fix line gains its magnitude arithmetic - hub: HEAD c49b5f0@main, P2 round row, matrix total 18, open 14 [skip ci]
2.0 KiB
2.0 KiB
F-018
- 状态:边界·待处理
- 范式:F13
- 位置:
src/main/java/com/pengu/thaumcraft/additions/gui/GUIDarkGenerator.java:35、:36;同型GUICondensator.java:39、GUIDarkInfuser.java:44、GUIHyperNodeCreator.java:31、:32、GUIInfuser.java:35、GUISealGlobe.java:76、GUIThaumicCrystallizer.java:34、GUIThaumicGenerator.java:32、GUIThaumicRestorer.java:33;src/main/java/com/pengu/thaumcraft/additions/utils/hud/TipMessage.java:35(宽度环:69-81,入口同包HUD.java:111) - 证据:
(GUIDarkGenerator.java:35;
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 3, 4210752);:36对Lang.localiseRaw("container.inventory")取两次翻译再做同式居中)(TipMessage.java:35;float decrease = this.getStringWidth(this.tipText) / 2.0F;tipText为 final 字段:9,宽度环:69-81逐字符loadGlyphTexture→renderEngine.bindTexture) - 机制:9 个
drawGuiContainerForegroundLayer与 HUD 提示每帧对不变串重测宽度、随即drawString内部再测一遍,偏移只用于居中。串与字体在开窗/提示存活期内不变(GUISealGlobe.java:67/:70同帧重取 TE 与组合描述属另一面,本块不计)。 - 频率:每帧(GUI 开启期)/每帧(提示存活期)。
- 修法:记录不修——量级算式:GUI 侧 10–20 字符测宽约 100–300 ns,
GUIDarkGenerator:35-36另加两次localiseRaw,GUISealGlobe:76含每行翻译与测宽合计 ≤3 µs/帧(16.6 ms 的 ≤0.02%);HUD 侧 10–40 字符 × 每次bindTexture0.2–1 µs ⇒ 2–40 µs/帧(16.6 ms 的 ≤0.25%)且仅提示存活期间。若要收:开窗期把标题串与宽度缓存在initGui/构造器,TipMessage在构造器算好decrease;宽度为定值,偏移逐像素不变。 - 风险 · 置信度:无 · 高(形态)
- 移交:无
- 来源:P2 2026-10-29
c49b5f0