xterm-addon-webgl
Advanced tools
Comparing version 0.13.0-beta.4 to 0.13.0-beta.5
{ | ||
"name": "xterm-addon-webgl", | ||
"version": "0.13.0-beta.4", | ||
"version": "0.13.0-beta.5", | ||
"author": { | ||
@@ -5,0 +5,0 @@ "name": "The xterm.js authors", |
@@ -172,7 +172,7 @@ /** | ||
public updateCell(x: number, y: number, code: number, bg: number, fg: number, chars: string): void { | ||
this._updateCell(this._vertices.attributes, x, y, code, bg, fg, chars); | ||
public updateCell(x: number, y: number, code: number, bg: number, fg: number, chars: string, lastBg: number): void { | ||
this._updateCell(this._vertices.attributes, x, y, code, bg, fg, chars, lastBg); | ||
} | ||
private _updateCell(array: Float32Array, x: number, y: number, code: number | undefined, bg: number, fg: number, chars?: string): void { | ||
private _updateCell(array: Float32Array, x: number, y: number, code: number | undefined, bg: number, fg: number, chars: string, lastBg: number): void { | ||
const terminal = this._terminal; | ||
@@ -207,14 +207,30 @@ | ||
// a_origin | ||
array[i ] = -rasterizedGlyph.offset.x + this._dimensions.scaledCharLeft; | ||
array[i + 1] = -rasterizedGlyph.offset.y + this._dimensions.scaledCharTop; | ||
// a_size | ||
array[i + 2] = rasterizedGlyph.size.x / this._dimensions.scaledCanvasWidth; | ||
array[i + 3] = rasterizedGlyph.size.y / this._dimensions.scaledCanvasHeight; | ||
// a_texcoord | ||
array[i + 4] = rasterizedGlyph.texturePositionClipSpace.x; | ||
array[i + 5] = rasterizedGlyph.texturePositionClipSpace.y; | ||
// a_texsize | ||
array[i + 6] = rasterizedGlyph.sizeClipSpace.x; | ||
array[i + 7] = rasterizedGlyph.sizeClipSpace.y; | ||
if (bg !== lastBg && rasterizedGlyph.offset.x > 0) { | ||
const clippedPixels = rasterizedGlyph.offset.x; | ||
// a_origin | ||
array[i ] = this._dimensions.scaledCharLeft; | ||
array[i + 1] = -rasterizedGlyph.offset.y + this._dimensions.scaledCharTop; | ||
// a_size | ||
array[i + 2] = (rasterizedGlyph.size.x - clippedPixels) / this._dimensions.scaledCanvasWidth; | ||
array[i + 3] = rasterizedGlyph.size.y / this._dimensions.scaledCanvasHeight; | ||
// a_texcoord | ||
array[i + 4] = rasterizedGlyph.texturePositionClipSpace.x + clippedPixels / this._atlas.cacheCanvas.width; | ||
array[i + 5] = rasterizedGlyph.texturePositionClipSpace.y; | ||
// a_texsize | ||
array[i + 6] = rasterizedGlyph.sizeClipSpace.x - clippedPixels / this._atlas.cacheCanvas.width; | ||
array[i + 7] = rasterizedGlyph.sizeClipSpace.y; | ||
} else { | ||
// a_origin | ||
array[i ] = -rasterizedGlyph.offset.x + this._dimensions.scaledCharLeft; | ||
array[i + 1] = -rasterizedGlyph.offset.y + this._dimensions.scaledCharTop; | ||
// a_size | ||
array[i + 2] = rasterizedGlyph.size.x / this._dimensions.scaledCanvasWidth; | ||
array[i + 3] = rasterizedGlyph.size.y / this._dimensions.scaledCanvasHeight; | ||
// a_texcoord | ||
array[i + 4] = rasterizedGlyph.texturePositionClipSpace.x; | ||
array[i + 5] = rasterizedGlyph.texturePositionClipSpace.y; | ||
// a_texsize | ||
array[i + 6] = rasterizedGlyph.sizeClipSpace.x; | ||
array[i + 7] = rasterizedGlyph.sizeClipSpace.y; | ||
} | ||
// a_cellpos only changes on resize | ||
@@ -221,0 +237,0 @@ } |
@@ -294,2 +294,3 @@ /** | ||
let cell: ICellData = this._workCell; | ||
let lastBg: number = 0; | ||
@@ -302,4 +303,9 @@ for (let y = start; y <= end; y++) { | ||
for (let x = 0; x < terminal.cols; x++) { | ||
lastBg = this._workColors.bg; | ||
line.loadCell(x, cell); | ||
if (x === 0) { | ||
lastBg = this._workColors.bg; | ||
} | ||
// If true, indicates that the current character(s) to draw were joined. | ||
@@ -356,3 +362,3 @@ let isJoined = false; | ||
this._glyphRenderer.updateCell(x, y, code, this._workColors.bg, this._workColors.fg, chars); | ||
this._glyphRenderer.updateCell(x, y, code, this._workColors.bg, this._workColors.fg, chars, lastBg); | ||
@@ -366,3 +372,3 @@ if (isJoined) { | ||
const j = ((y * terminal.cols) + x) * RENDER_MODEL_INDICIES_PER_CELL; | ||
this._glyphRenderer.updateCell(x, y, NULL_CELL_CODE, 0, 0, NULL_CELL_CHAR); | ||
this._glyphRenderer.updateCell(x, y, NULL_CELL_CODE, 0, 0, NULL_CELL_CHAR, 0); | ||
this._model.cells[j] = NULL_CELL_CODE; | ||
@@ -369,0 +375,0 @@ this._model.cells[j + RENDER_MODEL_BG_OFFSET] = this._workColors.bg; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
494065
3098