change property getter into methods
This commit is contained in:
@@ -239,7 +239,7 @@ export abstract class BaseRenderLayer implements IRenderLayer {
|
||||
this._ctx.textBaseline = 'middle';
|
||||
this._clipRow(terminal, y);
|
||||
this._ctx.fillText(
|
||||
cell.chars,
|
||||
cell.getChars(),
|
||||
x * this._scaledCellWidth + this._scaledCharLeft,
|
||||
(y + 0.5) * this._scaledCellHeight + this._scaledCharTop);
|
||||
}
|
||||
|
||||
@@ -56,8 +56,8 @@ export class CharacterJoinerRegistry implements ICharacterJoinerRegistry {
|
||||
|
||||
for (let x = 0; x < this._terminal.cols; x++) {
|
||||
line.loadCell(x, this._cell);
|
||||
const chars = this._cell.chars;
|
||||
const width = this._cell.width;
|
||||
const chars = this._cell.getChars();
|
||||
const width = this._cell.getWidth();
|
||||
const attr = this._cell.fg >> 9;
|
||||
|
||||
if (width === 0) {
|
||||
|
||||
@@ -143,7 +143,7 @@ export class CursorRenderLayer extends BaseRenderLayer {
|
||||
this._state.y = viewportRelativeCursorY;
|
||||
this._state.isFocused = false;
|
||||
this._state.style = terminal.options.cursorStyle;
|
||||
this._state.width = this._cell.width;
|
||||
this._state.width = this._cell.getWidth();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ export class CursorRenderLayer extends BaseRenderLayer {
|
||||
this._state.y === viewportRelativeCursorY &&
|
||||
this._state.isFocused === terminal.isFocused &&
|
||||
this._state.style === terminal.options.cursorStyle &&
|
||||
this._state.width === this._cell.width) {
|
||||
this._state.width === this._cell.getWidth()) {
|
||||
return;
|
||||
}
|
||||
this._clearCursor();
|
||||
@@ -173,7 +173,7 @@ export class CursorRenderLayer extends BaseRenderLayer {
|
||||
this._state.y = viewportRelativeCursorY;
|
||||
this._state.isFocused = false;
|
||||
this._state.style = terminal.options.cursorStyle;
|
||||
this._state.width = this._cell.width;
|
||||
this._state.width = this._cell.getWidth();
|
||||
}
|
||||
|
||||
private _clearCursor(): void {
|
||||
@@ -199,7 +199,7 @@ export class CursorRenderLayer extends BaseRenderLayer {
|
||||
private _renderBlockCursor(terminal: ITerminal, x: number, y: number, cell: ICellData): void {
|
||||
this._ctx.save();
|
||||
this._ctx.fillStyle = this._colors.cursor.css;
|
||||
this.fillCells(x, y, cell.width, 1);
|
||||
this.fillCells(x, y, cell.getWidth(), 1);
|
||||
this._ctx.fillStyle = this._colors.cursorAccent.css;
|
||||
this.fillCharTrueColor(terminal, cell, x, y);
|
||||
this._ctx.restore();
|
||||
@@ -215,7 +215,7 @@ export class CursorRenderLayer extends BaseRenderLayer {
|
||||
private _renderBlurCursor(terminal: ITerminal, x: number, y: number, cell: ICellData): void {
|
||||
this._ctx.save();
|
||||
this._ctx.strokeStyle = this._colors.cursor.css;
|
||||
this.strokeRectAtCell(x, y, cell.width, 1);
|
||||
this.strokeRectAtCell(x, y, cell.getWidth(), 1);
|
||||
this._ctx.restore();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,13 +75,13 @@ export class TextRenderLayer extends BaseRenderLayer {
|
||||
const joinedRanges = joinerRegistry ? joinerRegistry.getJoinedCharacters(row) : [];
|
||||
for (let x = 0; x < terminal.cols; x++) {
|
||||
(line as any).loadCell(x, this._cell);
|
||||
let code: number = this._cell.code || WHITESPACE_CELL_CODE;
|
||||
let code: number = this._cell.getCode() || WHITESPACE_CELL_CODE;
|
||||
|
||||
// Can either represent character(s) for a single cell or multiple cells
|
||||
// if indicated by a character joiner.
|
||||
let chars = this._cell.chars || WHITESPACE_CELL_CHAR;
|
||||
let chars = this._cell.getChars() || WHITESPACE_CELL_CHAR;
|
||||
const attr = this._cell.fg;
|
||||
let width = this._cell.width;
|
||||
let width = this._cell.getWidth();
|
||||
|
||||
// If true, indicates that the current character(s) to draw were joined.
|
||||
let isJoined = false;
|
||||
@@ -127,7 +127,7 @@ export class TextRenderLayer extends BaseRenderLayer {
|
||||
// get removed, and `a` would not re-render because it thinks it's
|
||||
// already in the correct state.
|
||||
// this._state.cache[x][y] = OVERLAP_OWNED_CHAR_DATA;
|
||||
if (lastCharX < line.length - 1 && line.loadCell(lastCharX + 1, this._cell).code === NULL_CELL_CODE) {
|
||||
if (lastCharX < line.length - 1 && line.loadCell(lastCharX + 1, this._cell).getCode() === NULL_CELL_CODE) {
|
||||
width = 2;
|
||||
// this._clearChar(x + 1, y);
|
||||
// The overlapping char's char data will force a clear and render when the
|
||||
|
||||
@@ -33,7 +33,7 @@ export class DomRendererRowFactory {
|
||||
// the viewport).
|
||||
let lineLength = 0;
|
||||
for (let x = Math.min(lineData.length, cols) - 1; x >= 0; x--) {
|
||||
if (lineData.loadCell(x, this._cell).code !== NULL_CELL_CODE || (isCursorRow && x === cursorX)) {
|
||||
if (lineData.loadCell(x, this._cell).getCode() !== NULL_CELL_CODE || (isCursorRow && x === cursorX)) {
|
||||
lineLength = x + 1;
|
||||
break;
|
||||
}
|
||||
@@ -42,7 +42,7 @@ export class DomRendererRowFactory {
|
||||
for (let x = 0; x < lineLength; x++) {
|
||||
lineData.loadCell(x, this._cell);
|
||||
const attr = this._cell.fg;
|
||||
const width = this._cell.width;
|
||||
const width = this._cell.getWidth();
|
||||
|
||||
// The character to the left is a wide character, drawing is owned by the char at x-1
|
||||
if (width === 0) {
|
||||
@@ -100,7 +100,7 @@ export class DomRendererRowFactory {
|
||||
charElement.classList.add(ITALIC_CLASS);
|
||||
}
|
||||
|
||||
charElement.textContent = this._cell.chars || WHITESPACE_CELL_CHAR;
|
||||
charElement.textContent = this._cell.getChars() || WHITESPACE_CELL_CHAR;
|
||||
if (fg !== DEFAULT_COLOR) {
|
||||
charElement.classList.add(`xterm-fg-${fg}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user