mirror of
https://github.com/YuleBest/FontMM.git
synced 2026-12-04 03:11:48 +08:00
fix(webui): 清空槽位后字重映射的轴范围不刷新
字重映射的 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, 简体的可变字体状态保持正确。
This commit is contained in:
1 parent
309cba2d29
commit
3969b50105
1 file changed
+6
@@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user