提交 01ee80de 编写于 作者: D Daniel Imms

Properly consider lettingSpacing for terminal dimensions

Fixes #86425
上级 7c7b8bdf
......@@ -135,9 +135,10 @@ export class TerminalConfigHelper implements IBrowserTerminalConfigHelper {
if (this.config.rendererType === 'dom') {
this._lastFontMeasurement.charWidth = rect.width;
} else {
const scaledCharWidth = rect.width * window.devicePixelRatio;
const scaledCharWidth = Math.floor(rect.width * window.devicePixelRatio);
const scaledCellWidth = scaledCharWidth + Math.round(letterSpacing);
this._lastFontMeasurement.charWidth = Math.round(scaledCellWidth / window.devicePixelRatio);
const actualCellWidth = scaledCellWidth / window.devicePixelRatio;
this._lastFontMeasurement.charWidth = actualCellWidth - Math.round(letterSpacing) / window.devicePixelRatio;
}
}
......@@ -188,7 +189,7 @@ export class TerminalConfigHelper implements IBrowserTerminalConfigHelper {
letterSpacing,
lineHeight,
charHeight: xtermCore._renderService.dimensions.actualCellHeight / lineHeight,
charWidth: xtermCore._renderService.dimensions.actualCellWidth
charWidth: xtermCore._renderService.dimensions.actualCellWidth - Math.round(letterSpacing) / window.devicePixelRatio
};
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册