Merge branch 'master' into 3056_hover_callback_link_providers
This commit is contained in:
@@ -116,12 +116,8 @@ export class WebglRenderer extends Disposable implements IRenderer {
|
|||||||
|
|
||||||
this._refreshCharAtlas();
|
this._refreshCharAtlas();
|
||||||
|
|
||||||
this._rectangleRenderer.updateSelection(this._model.selection);
|
|
||||||
this._glyphRenderer.updateSelection(this._model);
|
|
||||||
|
|
||||||
// Force a full refresh
|
// Force a full refresh
|
||||||
this._model.clear();
|
this._model.clear();
|
||||||
this._model.clearSelection();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public onDevicePixelRatioChange(): void {
|
public onDevicePixelRatioChange(): void {
|
||||||
@@ -138,7 +134,6 @@ export class WebglRenderer extends Disposable implements IRenderer {
|
|||||||
this._updateDimensions();
|
this._updateDimensions();
|
||||||
|
|
||||||
this._model.resize(this._terminal.cols, this._terminal.rows);
|
this._model.resize(this._terminal.cols, this._terminal.rows);
|
||||||
this._rectangleRenderer.onResize();
|
|
||||||
|
|
||||||
// Resize all render layers
|
// Resize all render layers
|
||||||
this._renderLayers.forEach(l => l.resize(this._terminal, this.dimensions));
|
this._renderLayers.forEach(l => l.resize(this._terminal, this.dimensions));
|
||||||
@@ -152,6 +147,13 @@ export class WebglRenderer extends Disposable implements IRenderer {
|
|||||||
// Resize the screen
|
// Resize the screen
|
||||||
this._core.screenElement!.style.width = `${this.dimensions.canvasWidth}px`;
|
this._core.screenElement!.style.width = `${this.dimensions.canvasWidth}px`;
|
||||||
this._core.screenElement!.style.height = `${this.dimensions.canvasHeight}px`;
|
this._core.screenElement!.style.height = `${this.dimensions.canvasHeight}px`;
|
||||||
|
|
||||||
|
this._rectangleRenderer.onResize();
|
||||||
|
if (this._model.selection.hasSelection) {
|
||||||
|
// Update selection as dimensions have changed
|
||||||
|
this._rectangleRenderer.updateSelection(this._model.selection);
|
||||||
|
}
|
||||||
|
|
||||||
this._glyphRenderer.setDimensions(this.dimensions);
|
this._glyphRenderer.setDimensions(this.dimensions);
|
||||||
this._glyphRenderer.onResize();
|
this._glyphRenderer.onResize();
|
||||||
|
|
||||||
@@ -159,7 +161,6 @@ export class WebglRenderer extends Disposable implements IRenderer {
|
|||||||
|
|
||||||
// Force a full refresh
|
// Force a full refresh
|
||||||
this._model.clear();
|
this._model.clear();
|
||||||
this._model.clearSelection();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public onCharSizeChanged(): void {
|
public onCharSizeChanged(): void {
|
||||||
@@ -179,9 +180,6 @@ export class WebglRenderer extends Disposable implements IRenderer {
|
|||||||
|
|
||||||
this._updateSelectionModel(start, end, columnSelectMode);
|
this._updateSelectionModel(start, end, columnSelectMode);
|
||||||
|
|
||||||
this._rectangleRenderer.updateSelection(this._model.selection);
|
|
||||||
this._glyphRenderer.updateSelection(this._model);
|
|
||||||
|
|
||||||
this._onRequestRedraw.fire({ start: 0, end: this._terminal.rows - 1 });
|
this._onRequestRedraw.fire({ start: 0, end: this._terminal.rows - 1 });
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,7 +218,6 @@ export class WebglRenderer extends Disposable implements IRenderer {
|
|||||||
this._charAtlas?.clearTexture();
|
this._charAtlas?.clearTexture();
|
||||||
this._model.clear();
|
this._model.clear();
|
||||||
this._updateModel(0, this._terminal.rows - 1);
|
this._updateModel(0, this._terminal.rows - 1);
|
||||||
this._glyphRenderer.updateSelection(this._model);
|
|
||||||
this._onRequestRedraw.fire({ start: 0, end: this._terminal.rows - 1 });
|
this._onRequestRedraw.fire({ start: 0, end: this._terminal.rows - 1 });
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,7 +250,7 @@ export class WebglRenderer extends Disposable implements IRenderer {
|
|||||||
// Tell renderer the frame is beginning
|
// Tell renderer the frame is beginning
|
||||||
if (this._glyphRenderer.beginFrame()) {
|
if (this._glyphRenderer.beginFrame()) {
|
||||||
this._model.clear();
|
this._model.clear();
|
||||||
this._model.clearSelection();
|
this._updateSelectionModel(undefined, undefined);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update model to reflect what's drawn
|
// Update model to reflect what's drawn
|
||||||
@@ -303,14 +300,19 @@ export class WebglRenderer extends Disposable implements IRenderer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this._rectangleRenderer.updateBackgrounds(this._model);
|
this._rectangleRenderer.updateBackgrounds(this._model);
|
||||||
|
if (this._model.selection.hasSelection) {
|
||||||
|
// Model could be updated but the selection is unchanged
|
||||||
|
this._glyphRenderer.updateSelection(this._model);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private _updateSelectionModel(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean): void {
|
private _updateSelectionModel(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean = false): void {
|
||||||
const terminal = this._terminal;
|
const terminal = this._terminal;
|
||||||
|
|
||||||
// Selection does not exist
|
// Selection does not exist
|
||||||
if (!start || !end || (start[0] === end[0] && start[1] === end[1])) {
|
if (!start || !end || (start[0] === end[0] && start[1] === end[1])) {
|
||||||
this._model.clearSelection();
|
this._model.clearSelection();
|
||||||
|
this._rectangleRenderer.updateSelection(this._model.selection);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -323,6 +325,7 @@ export class WebglRenderer extends Disposable implements IRenderer {
|
|||||||
// No need to draw the selection
|
// No need to draw the selection
|
||||||
if (viewportCappedStartRow >= terminal.rows || viewportCappedEndRow < 0) {
|
if (viewportCappedStartRow >= terminal.rows || viewportCappedEndRow < 0) {
|
||||||
this._model.clearSelection();
|
this._model.clearSelection();
|
||||||
|
this._rectangleRenderer.updateSelection(this._model.selection);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -334,6 +337,8 @@ export class WebglRenderer extends Disposable implements IRenderer {
|
|||||||
this._model.selection.viewportCappedEndRow = viewportCappedEndRow;
|
this._model.selection.viewportCappedEndRow = viewportCappedEndRow;
|
||||||
this._model.selection.startCol = start[0];
|
this._model.selection.startCol = start[0];
|
||||||
this._model.selection.endCol = end[0];
|
this._model.selection.endCol = end[0];
|
||||||
|
|
||||||
|
this._rectangleRenderer.updateSelection(this._model.selection);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user