xterm-addon-webgl
Advanced tools
Comparing version 0.10.0 to 0.11.0-beta.1
@@ -80,3 +80,6 @@ "use strict"; | ||
WebglRenderer.prototype.dispose = function () { | ||
this._renderLayers.forEach(function (l) { return l.dispose(); }); | ||
for (var _i = 0, _a = this._renderLayers; _i < _a.length; _i++) { | ||
var l = _a[_i]; | ||
l.dispose(); | ||
} | ||
this._core.screenElement.removeChild(this._canvas); | ||
@@ -94,8 +97,8 @@ _super.prototype.dispose.call(this); | ||
WebglRenderer.prototype.setColors = function (colors) { | ||
var _this = this; | ||
this._colors = colors; | ||
this._renderLayers.forEach(function (l) { | ||
l.setColors(_this._terminal, _this._colors); | ||
l.reset(_this._terminal); | ||
}); | ||
for (var _i = 0, _a = this._renderLayers; _i < _a.length; _i++) { | ||
var l = _a[_i]; | ||
l.setColors(this._terminal, this._colors); | ||
l.reset(this._terminal); | ||
} | ||
this._rectangleRenderer.setColors(); | ||
@@ -113,6 +116,8 @@ this._glyphRenderer.setColors(); | ||
WebglRenderer.prototype.onResize = function (cols, rows) { | ||
var _this = this; | ||
this._updateDimensions(); | ||
this._model.resize(this._terminal.cols, this._terminal.rows); | ||
this._renderLayers.forEach(function (l) { return l.resize(_this._terminal, _this.dimensions); }); | ||
for (var _i = 0, _a = this._renderLayers; _i < _a.length; _i++) { | ||
var l = _a[_i]; | ||
l.resize(this._terminal, this.dimensions); | ||
} | ||
this._canvas.width = this.dimensions.scaledCanvasWidth; | ||
@@ -137,12 +142,18 @@ this._canvas.height = this.dimensions.scaledCanvasHeight; | ||
WebglRenderer.prototype.onBlur = function () { | ||
var _this = this; | ||
this._renderLayers.forEach(function (l) { return l.onBlur(_this._terminal); }); | ||
for (var _i = 0, _a = this._renderLayers; _i < _a.length; _i++) { | ||
var l = _a[_i]; | ||
l.onBlur(this._terminal); | ||
} | ||
}; | ||
WebglRenderer.prototype.onFocus = function () { | ||
var _this = this; | ||
this._renderLayers.forEach(function (l) { return l.onFocus(_this._terminal); }); | ||
for (var _i = 0, _a = this._renderLayers; _i < _a.length; _i++) { | ||
var l = _a[_i]; | ||
l.onFocus(this._terminal); | ||
} | ||
}; | ||
WebglRenderer.prototype.onSelectionChanged = function (start, end, columnSelectMode) { | ||
var _this = this; | ||
this._renderLayers.forEach(function (l) { return l.onSelectionChanged(_this._terminal, start, end, columnSelectMode); }); | ||
for (var _i = 0, _a = this._renderLayers; _i < _a.length; _i++) { | ||
var l = _a[_i]; | ||
l.onSelectionChanged(this._terminal, start, end, columnSelectMode); | ||
} | ||
this._updateSelectionModel(start, end, columnSelectMode); | ||
@@ -152,8 +163,12 @@ this._onRequestRedraw.fire({ start: 0, end: this._terminal.rows - 1 }); | ||
WebglRenderer.prototype.onCursorMove = function () { | ||
var _this = this; | ||
this._renderLayers.forEach(function (l) { return l.onCursorMove(_this._terminal); }); | ||
for (var _i = 0, _a = this._renderLayers; _i < _a.length; _i++) { | ||
var l = _a[_i]; | ||
l.onCursorMove(this._terminal); | ||
} | ||
}; | ||
WebglRenderer.prototype.onOptionsChanged = function () { | ||
var _this = this; | ||
this._renderLayers.forEach(function (l) { return l.onOptionsChanged(_this._terminal); }); | ||
for (var _i = 0, _a = this._renderLayers; _i < _a.length; _i++) { | ||
var l = _a[_i]; | ||
l.onOptionsChanged(this._terminal); | ||
} | ||
this._updateDimensions(); | ||
@@ -183,4 +198,6 @@ this._refreshCharAtlas(); | ||
WebglRenderer.prototype.clear = function () { | ||
var _this = this; | ||
this._renderLayers.forEach(function (l) { return l.reset(_this._terminal); }); | ||
for (var _i = 0, _a = this._renderLayers; _i < _a.length; _i++) { | ||
var l = _a[_i]; | ||
l.reset(this._terminal); | ||
} | ||
}; | ||
@@ -194,3 +211,2 @@ WebglRenderer.prototype.registerCharacterJoiner = function (handler) { | ||
WebglRenderer.prototype.renderRows = function (start, end) { | ||
var _this = this; | ||
if (!this._isAttached) { | ||
@@ -206,3 +222,6 @@ if (document.body.contains(this._core.screenElement) && this._core._charSizeService.width && this._core._charSizeService.height) { | ||
} | ||
this._renderLayers.forEach(function (l) { return l.onGridChanged(_this._terminal, start, end); }); | ||
for (var _i = 0, _a = this._renderLayers; _i < _a.length; _i++) { | ||
var l = _a[_i]; | ||
l.onGridChanged(this._terminal, start, end); | ||
} | ||
if (this._glyphRenderer.beginFrame()) { | ||
@@ -209,0 +228,0 @@ this._model.clear(); |
{ | ||
"name": "xterm-addon-webgl", | ||
"version": "0.10.0", | ||
"version": "0.11.0-beta.1", | ||
"author": { | ||
@@ -5,0 +5,0 @@ "name": "The xterm.js authors", |
@@ -97,3 +97,5 @@ /** | ||
public dispose(): void { | ||
this._renderLayers.forEach(l => l.dispose()); | ||
for (const l of this._renderLayers) { | ||
l.dispose(); | ||
} | ||
this._core.screenElement!.removeChild(this._canvas); | ||
@@ -110,6 +112,6 @@ super.dispose(); | ||
// Clear layers and force a full render | ||
this._renderLayers.forEach(l => { | ||
for (const l of this._renderLayers) { | ||
l.setColors(this._terminal, this._colors); | ||
l.reset(this._terminal); | ||
}); | ||
} | ||
@@ -141,3 +143,5 @@ this._rectangleRenderer.setColors(); | ||
// Resize all render layers | ||
this._renderLayers.forEach(l => l.resize(this._terminal, this.dimensions)); | ||
for (const l of this._renderLayers) { | ||
l.resize(this._terminal, this.dimensions); | ||
} | ||
@@ -174,11 +178,17 @@ // Resize the canvas | ||
public onBlur(): void { | ||
this._renderLayers.forEach(l => l.onBlur(this._terminal)); | ||
for (const l of this._renderLayers) { | ||
l.onBlur(this._terminal); | ||
} | ||
} | ||
public onFocus(): void { | ||
this._renderLayers.forEach(l => l.onFocus(this._terminal)); | ||
for (const l of this._renderLayers) { | ||
l.onFocus(this._terminal); | ||
} | ||
} | ||
public onSelectionChanged(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean): void { | ||
this._renderLayers.forEach(l => l.onSelectionChanged(this._terminal, start, end, columnSelectMode)); | ||
for (const l of this._renderLayers) { | ||
l.onSelectionChanged(this._terminal, start, end, columnSelectMode); | ||
} | ||
@@ -191,7 +201,11 @@ this._updateSelectionModel(start, end, columnSelectMode); | ||
public onCursorMove(): void { | ||
this._renderLayers.forEach(l => l.onCursorMove(this._terminal)); | ||
for (const l of this._renderLayers) { | ||
l.onCursorMove(this._terminal); | ||
} | ||
} | ||
public onOptionsChanged(): void { | ||
this._renderLayers.forEach(l => l.onOptionsChanged(this._terminal)); | ||
for (const l of this._renderLayers) { | ||
l.onOptionsChanged(this._terminal); | ||
} | ||
this._updateDimensions(); | ||
@@ -230,3 +244,5 @@ this._refreshCharAtlas(); | ||
public clear(): void { | ||
this._renderLayers.forEach(l => l.reset(this._terminal)); | ||
for (const l of this._renderLayers) { | ||
l.reset(this._terminal); | ||
} | ||
} | ||
@@ -254,3 +270,5 @@ | ||
// Update render layers | ||
this._renderLayers.forEach(l => l.onGridChanged(this._terminal, start, end)); | ||
for (const l of this._renderLayers) { | ||
l.onGridChanged(this._terminal, start, end); | ||
} | ||
@@ -257,0 +275,0 @@ // Tell renderer the frame is beginning |
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
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
580653
5051