ensure line is defined via clamp (#4403)
This commit is contained in:
@@ -366,7 +366,8 @@ export class WebglRenderer extends Disposable implements IRenderer {
|
|||||||
let i: number;
|
let i: number;
|
||||||
let x: number;
|
let x: number;
|
||||||
let j: number;
|
let j: number;
|
||||||
|
start = clamp(start, terminal.rows - 1, 0);
|
||||||
|
end = clamp(end, terminal.rows - 1, 0);
|
||||||
for (y = start; y <= end; y++) {
|
for (y = start; y <= end; y++) {
|
||||||
row = y + terminal.buffer.ydisp;
|
row = y + terminal.buffer.ydisp;
|
||||||
line = terminal.buffer.lines.get(row)!;
|
line = terminal.buffer.lines.get(row)!;
|
||||||
@@ -570,3 +571,7 @@ export class JoinedCellData extends AttributeData implements ICellData {
|
|||||||
return [this.fg, this.getChars(), this.getWidth(), this.getCode()];
|
return [this.fg, this.getChars(), this.getWidth(), this.getCode()];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function clamp(value: number, max: number, min: number = 0): number {
|
||||||
|
return Math.max(Math.min(value, max), min);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user