xterm-addon-webgl
Advanced tools
Comparing version 0.8.0 to 0.9.0-beta.1
@@ -69,8 +69,4 @@ "use strict"; | ||
if (this._currentRowY > TEXTURE_CAPACITY) { | ||
this._cacheCtx.clearRect(0, 0, TEXTURE_WIDTH, TEXTURE_HEIGHT); | ||
this._cacheMap = {}; | ||
this._currentRowHeight = 0; | ||
this._currentRowX = 0; | ||
this._currentRowY = 0; | ||
this._doWarmUp(); | ||
this.clearTexture(); | ||
this.warmUp(); | ||
return true; | ||
@@ -80,2 +76,14 @@ } | ||
}; | ||
WebglCharAtlas.prototype.clearTexture = function () { | ||
if (this._currentRowX === 0 && this._currentRowY === 0) { | ||
return; | ||
} | ||
this._cacheCtx.clearRect(0, 0, TEXTURE_WIDTH, TEXTURE_HEIGHT); | ||
this._cacheMap = {}; | ||
this._cacheMapCombined = {}; | ||
this._currentRowHeight = 0; | ||
this._currentRowX = 0; | ||
this._currentRowY = 0; | ||
this._didWarmUp = false; | ||
}; | ||
WebglCharAtlas.prototype.getRasterizedGlyphCombinedChar = function (chars, bg, fg) { | ||
@@ -82,0 +90,0 @@ var rasterizedGlyphSet = this._cacheMapCombined[chars]; |
@@ -6,3 +6,3 @@ "use strict"; | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
@@ -9,0 +9,0 @@ }; |
@@ -6,3 +6,3 @@ "use strict"; | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
@@ -9,0 +9,0 @@ }; |
@@ -34,3 +34,2 @@ "use strict"; | ||
TypedArrayUtils_1.fill(this.lineLengths, 0, 0); | ||
this.clearSelection(); | ||
}; | ||
@@ -37,0 +36,0 @@ RenderModel.prototype.clearSelection = function () { |
@@ -36,2 +36,6 @@ "use strict"; | ||
}); | ||
WebglAddon.prototype.clearTextureAtlas = function () { | ||
var _a; | ||
(_a = this._renderer) === null || _a === void 0 ? void 0 : _a.clearCharAtlas(); | ||
}; | ||
return WebglAddon; | ||
@@ -38,0 +42,0 @@ }()); |
@@ -6,3 +6,3 @@ "use strict"; | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
@@ -106,2 +106,3 @@ }; | ||
this._model.clear(); | ||
this._model.clearSelection(); | ||
}; | ||
@@ -130,2 +131,3 @@ WebglRenderer.prototype.onDevicePixelRatioChange = function () { | ||
this._model.clear(); | ||
this._model.clearSelection(); | ||
}; | ||
@@ -174,2 +176,10 @@ WebglRenderer.prototype.onCharSizeChanged = function () { | ||
}; | ||
WebglRenderer.prototype.clearCharAtlas = function () { | ||
var _a; | ||
(_a = this._charAtlas) === null || _a === void 0 ? void 0 : _a.clearTexture(); | ||
this._model.clear(); | ||
this._updateModel(0, this._terminal.rows - 1); | ||
this._glyphRenderer.updateSelection(this._model); | ||
this._onRequestRedraw.fire({ start: 0, end: this._terminal.rows - 1 }); | ||
}; | ||
WebglRenderer.prototype.clear = function () { | ||
@@ -200,2 +210,3 @@ var _this = this; | ||
this._model.clear(); | ||
this._model.clearSelection(); | ||
} | ||
@@ -202,0 +213,0 @@ this._updateModel(start, end); |
{ | ||
"name": "xterm-addon-webgl", | ||
"version": "0.8.0", | ||
"version": "0.9.0-beta.1", | ||
"author": { | ||
@@ -5,0 +5,0 @@ "name": "The xterm.js authors", |
@@ -104,3 +104,3 @@ /** | ||
protected _doWarmUp(): void { | ||
private _doWarmUp(): void { | ||
// Pre-fill with ASCII 33-126 | ||
@@ -119,8 +119,4 @@ for (let i = 33; i < 126; i++) { | ||
if (this._currentRowY > TEXTURE_CAPACITY) { | ||
this._cacheCtx.clearRect(0, 0, TEXTURE_WIDTH, TEXTURE_HEIGHT); | ||
this._cacheMap = {}; | ||
this._currentRowHeight = 0; | ||
this._currentRowX = 0; | ||
this._currentRowY = 0; | ||
this._doWarmUp(); | ||
this.clearTexture(); | ||
this.warmUp(); | ||
return true; | ||
@@ -131,2 +127,15 @@ } | ||
public clearTexture(): void { | ||
if (this._currentRowX === 0 && this._currentRowY === 0) { | ||
return; | ||
} | ||
this._cacheCtx.clearRect(0, 0, TEXTURE_WIDTH, TEXTURE_HEIGHT); | ||
this._cacheMap = {}; | ||
this._cacheMapCombined = {}; | ||
this._currentRowHeight = 0; | ||
this._currentRowX = 0; | ||
this._currentRowY = 0; | ||
this._didWarmUp = false; | ||
} | ||
public getRasterizedGlyphCombinedChar(chars: string, bg: number, fg: number): IRasterizedGlyph { | ||
@@ -133,0 +142,0 @@ let rasterizedGlyphSet = this._cacheMapCombined[chars]; |
@@ -46,3 +46,2 @@ /** | ||
fill(this.lineLengths, 0, 0); | ||
this.clearSelection(); | ||
} | ||
@@ -49,0 +48,0 @@ |
@@ -43,2 +43,6 @@ /** | ||
} | ||
public clearTextureAtlas(): void { | ||
this._renderer?.clearCharAtlas(); | ||
} | ||
} |
@@ -124,2 +124,3 @@ /** | ||
this._model.clear(); | ||
this._model.clearSelection(); | ||
} | ||
@@ -162,2 +163,3 @@ | ||
this._model.clear(); | ||
this._model.clearSelection(); | ||
} | ||
@@ -219,2 +221,10 @@ | ||
public clearCharAtlas(): void { | ||
this._charAtlas?.clearTexture(); | ||
this._model.clear(); | ||
this._updateModel(0, this._terminal.rows - 1); | ||
this._glyphRenderer.updateSelection(this._model); | ||
this._onRequestRedraw.fire({ start: 0, end: this._terminal.rows - 1 }); | ||
} | ||
public clear(): void { | ||
@@ -249,2 +259,3 @@ this._renderLayers.forEach(l => l.reset(this._terminal)); | ||
this._model.clear(); | ||
this._model.clearSelection(); | ||
} | ||
@@ -251,0 +262,0 @@ |
@@ -6,3 +6,3 @@ /** | ||
import { Terminal, IDisposable, ITerminalAddon } from 'xterm'; | ||
import { Terminal, ITerminalAddon } from 'xterm'; | ||
@@ -19,3 +19,3 @@ declare module 'xterm-addon-webgl' { | ||
/** | ||
* Activates the addon | ||
* Activates the addon. | ||
* @param terminal The terminal the addon is being loaded in. | ||
@@ -29,3 +29,8 @@ */ | ||
public dispose(): void; | ||
/** | ||
* Clears the terminal's texture atlas and triggers a redraw. | ||
*/ | ||
public clearTextureAtlas(): void; | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
640600
5010