提交 9989abf5 编写于 作者: D Daniel Imms

Correct term char width calculation under DOM renderer

Fixes #51479
上级 54fd81db
......@@ -205,7 +205,13 @@ export class TerminalInstance implements ITerminalInstance {
// order to be precise. font.charWidth/charHeight alone as insufficient
// when window.devicePixelRatio changes.
const scaledWidthAvailable = dimension.width * window.devicePixelRatio;
const scaledCharWidth = Math.floor(font.charWidth * window.devicePixelRatio) + font.letterSpacing;
let scaledCharWidth: number;
if (this._configHelper.config.rendererType === 'dom') {
scaledCharWidth = font.charWidth * window.devicePixelRatio;
} else {
scaledCharWidth = Math.floor(font.charWidth * window.devicePixelRatio) + font.letterSpacing;
}
this._cols = Math.max(Math.floor(scaledWidthAvailable / scaledCharWidth), 1);
const scaledHeightAvailable = dimension.height * window.devicePixelRatio;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册