Skip to content

Commit

Permalink
account for the UC length in name calc
Browse files Browse the repository at this point in the history
  • Loading branch information
tophf committed Dec 25, 2024
1 parent 9072078 commit e828432
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/manage/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ export function fitNameColumn(styles, style) {
function calcNameLenKey(style) {
const name = style.displayName || style.name || '';
const len = 1e9 + // aligning the key for sort() which uses string comparison
(style[UCD] ? 4 : 0) +
(style.enabled ? 1.05/*bold factor*/ : 1) *
(name.length + name.replace(rxNonCJK, '').length/*CJK glyph is 2x wide*/) | 0;
nameLengths.set(style.id, len);
Expand Down

0 comments on commit e828432

Please sign in to comment.