feat(编辑能力): 完善缺字诊断,优化字体选择体验
build.yaml / build (push) Successful in 40s

This commit is contained in:
xiaoqidun committed 2026-09-16 20:36:11 +08:00
1 parent bf27afea13
commit f924f008a3
9 files changed
+105 -29

No files matched your search

+3 -3
View File
@@ -80,7 +80,7 @@ export class FontPicker {
label.textContent = source;
option.append(label);
}
option.title = font.name || font.fullName;
option.title = [...new Set([font.fullName, font.name].filter(Boolean))].join(" · ");
this.list.append(option);
}
if (!this.matches.length) {
@@ -100,9 +100,9 @@ export class FontPicker {
position() {
if (!this.open) return;
const rect = this.input.getBoundingClientRect();
const rect = this.input.parentElement.getBoundingClientRect();
if (rect.right <= 0 || rect.left >= window.innerWidth) { this.close(); return; }
const width = Math.min(Math.max(rect.width, 260), window.innerWidth - 16);
const width = Math.min(rect.width, window.innerWidth - 16);
Object.assign(this.list.style, { left: `${Math.max(8, Math.min(rect.left, window.innerWidth - width - 8))}px`,
top: `${rect.bottom + 4}px`, width: `${width}px`, maxHeight: `${Math.max(40, Math.min(280, window.innerHeight - rect.bottom - 12))}px` });
}