From 3969b5010570076160f6779ee4d98fc547c6cd00 Mon Sep 17 00:00:00 2001 From: YuleBest Date: Wed, 16 Sep 2026 19:03:14 +0800 Subject: [PATCH] =?UTF-8?q?fix(webui):=20=E6=B8=85=E7=A9=BA=E6=A7=BD?= =?UTF-8?q?=E4=BD=8D=E5=90=8E=E5=AD=97=E9=87=8D=E6=98=A0=E5=B0=84=E7=9A=84?= =?UTF-8?q?=E8=BD=B4=E8=8C=83=E5=9B=B4=E4=B8=8D=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 字重映射的 wght 轴范围取自各槽位可变字体里跨度最小的那个 (pickWghtRange), 而 「清空槽位」只清了 path/fileName, 解析出来的 isVariable/wghtRange 留了下来 —— 于是删掉 200-900 的字体后, 范围仍被限制在 200-900, 可变字体标记也残留。 清空时一并重置 sizeText / isVariable / wghtRange / subsetSizeText: - 映射范围回到剩余可变字体的范围 (renderSlots 会触发 slots-rendered 重绘映射行) - 大小、可变字体徽标、英文子集徽标不会停留在已删除的字体上 浏览器实测: 选中 100-900(简) + 200-700(英) 后映射限制在 200-700, 清掉英文字体后 恢复为 100-900, 简体的可变字体状态保持正确。 --- web/src/slots.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/web/src/slots.ts b/web/src/slots.ts index bfebdff..02a1553 100644 --- a/web/src/slots.ts +++ b/web/src/slots.ts @@ -151,6 +151,12 @@ export function renderSlots() { const slot = slots[btn.dataset.key as SlotKey]; slot.path = null; slot.fileName = ''; + // 解析结果一并清掉: 否则字重映射的轴范围 (取各槽位最小跨度) 与可变字体标记 + // 会停留在被删掉的字体上 —— 删掉 200-900 的字体后仍只能选 200-900 + slot.sizeText = undefined; + slot.isVariable = false; + slot.wghtRange = undefined; + slot.subsetSizeText = undefined; renderSlots(); }); });