Add basic support for cursor blinking
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { IRenderLayer } from './Interfaces';
|
||||
import { ITerminal } from '../Interfaces';
|
||||
import { ITerminal, ITerminalOptions } from '../Interfaces';
|
||||
import { COLORS } from './Color';
|
||||
|
||||
export abstract class BaseRenderLayer implements IRenderLayer {
|
||||
@@ -27,6 +27,10 @@ export abstract class BaseRenderLayer implements IRenderLayer {
|
||||
}
|
||||
}
|
||||
|
||||
public onOptionsChanged(options: ITerminal): void {
|
||||
// TODO: Should this do anything?
|
||||
}
|
||||
|
||||
public resize(terminal: ITerminal, canvasWidth: number, canvasHeight: number, charSizeChanged: boolean): void {
|
||||
this.scaledCharWidth = terminal.charMeasure.width * window.devicePixelRatio;
|
||||
this.scaledCharHeight = terminal.charMeasure.height * window.devicePixelRatio;
|
||||
@@ -56,6 +60,22 @@ export abstract class BaseRenderLayer implements IRenderLayer {
|
||||
this._ctx.fillRect(startCol * this.scaledCharWidth, startRow * this.scaledCharHeight, colWidth * this.scaledCharWidth, colHeight * this.scaledCharHeight);
|
||||
}
|
||||
|
||||
protected fillBottomLineAtCell(x: number, y: number): void {
|
||||
this._ctx.fillRect(
|
||||
x * this.scaledCharWidth,
|
||||
(y + 1) * this.scaledCharHeight - window.devicePixelRatio - 1 /* Ensure it's drawn within the cell */,
|
||||
this.scaledCharWidth,
|
||||
window.devicePixelRatio);
|
||||
}
|
||||
|
||||
protected fillLeftLineAtCell(x: number, y: number): void {
|
||||
this._ctx.fillRect(
|
||||
x * this.scaledCharWidth,
|
||||
y * this.scaledCharHeight,
|
||||
window.devicePixelRatio,
|
||||
this.scaledCharHeight);
|
||||
}
|
||||
|
||||
protected clearAll(): void {
|
||||
this._ctx.clearRect(0, 0, this._canvas.width, this._canvas.height);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user