Skip to content

Commit 3023a7c

Browse files
authored
fix: use correct font to measure column title width (#1040)
* fix: use correct font to measure column title width * restore original font
1 parent 96d1830 commit 3023a7c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/core/src/data-editor/use-column-sizer.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ export function measureColumn(
6262
}
6363
}
6464
}
65+
const currentFont = ctx.font;
66+
ctx.font = theme.headerFontFull;
6567
max = Math.max(max, ctx.measureText(c.title).width + theme.cellHorizontalPadding * 2 + (c.icon === undefined ? 0 : 28));
68+
ctx.font = currentFont;
6669
const final = Math.max(Math.ceil(minColumnWidth), Math.min(Math.floor(maxColumnWidth), Math.ceil(max)));
6770

6871
return {

0 commit comments

Comments
 (0)