Fix canvas resizing with non-1 lineHeight
This commit is contained in:
@@ -48,13 +48,13 @@ export class Renderer {
|
|||||||
|
|
||||||
public onResize(cols: number, rows: number): void {
|
public onResize(cols: number, rows: number): void {
|
||||||
const width = this._terminal.charMeasure.width * this._terminal.cols;
|
const width = this._terminal.charMeasure.width * this._terminal.cols;
|
||||||
const height = Math.ceil(this._terminal.charMeasure.height * this._terminal.options.lineHeight) * this._terminal.rows;
|
const height = Math.floor(this._terminal.charMeasure.height * this._terminal.options.lineHeight) * this._terminal.rows;
|
||||||
this._renderLayers.forEach(l => l.resize(this._terminal, width, height, false));
|
this._renderLayers.forEach(l => l.resize(this._terminal, width, height, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
public onCharSizeChanged(charWidth: number, charHeight: number): void {
|
public onCharSizeChanged(charWidth: number, charHeight: number): void {
|
||||||
const width = charWidth * this._terminal.cols;
|
const width = charWidth * this._terminal.cols;
|
||||||
const height = charHeight * this._terminal.rows;
|
const height = Math.floor(charHeight * this._terminal.options.lineHeight) * this._terminal.rows;
|
||||||
this._renderLayers.forEach(l => l.resize(this._terminal, width, height, true));
|
this._renderLayers.forEach(l => l.resize(this._terminal, width, height, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user