Reduce diff with master
This commit is contained in:
@@ -40,10 +40,9 @@ export function acquireCharAtlas(
|
|||||||
terminal: ITerminal,
|
terminal: ITerminal,
|
||||||
colors: IColorSet,
|
colors: IColorSet,
|
||||||
scaledCharWidth: number,
|
scaledCharWidth: number,
|
||||||
scaledCharHeight: number,
|
scaledCharHeight: number
|
||||||
devicePixelRatio?: number
|
|
||||||
): BaseCharAtlas {
|
): BaseCharAtlas {
|
||||||
const newConfig = generateConfig(scaledCharWidth, scaledCharHeight, terminal, colors, devicePixelRatio);
|
const newConfig = generateConfig(scaledCharWidth, scaledCharHeight, terminal, colors);
|
||||||
|
|
||||||
// TODO: Currently if a terminal changes configs it will not free the entry reference (until it's disposed)
|
// TODO: Currently if a terminal changes configs it will not free the entry reference (until it's disposed)
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { ITerminal } from '../../Types';
|
|||||||
import { IColorSet } from '../Types';
|
import { IColorSet } from '../Types';
|
||||||
import { DEFAULT_COLOR, ICharAtlasConfig } from './Types';
|
import { DEFAULT_COLOR, ICharAtlasConfig } from './Types';
|
||||||
|
|
||||||
export function generateConfig(scaledCharWidth: number, scaledCharHeight: number, terminal: ITerminal, colors: IColorSet, devicePixelRatio: number = window.devicePixelRatio): ICharAtlasConfig {
|
export function generateConfig(scaledCharWidth: number, scaledCharHeight: number, terminal: ITerminal, colors: IColorSet): ICharAtlasConfig {
|
||||||
// null out some fields that don't matter
|
// null out some fields that don't matter
|
||||||
const clonedColors = <IColorSet>{
|
const clonedColors = <IColorSet>{
|
||||||
foreground: colors.foreground,
|
foreground: colors.foreground,
|
||||||
@@ -21,7 +21,7 @@ export function generateConfig(scaledCharWidth: number, scaledCharHeight: number
|
|||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
type: terminal.options.experimentalCharAtlas,
|
type: terminal.options.experimentalCharAtlas,
|
||||||
devicePixelRatio,
|
devicePixelRatio: window.devicePixelRatio,
|
||||||
scaledCharWidth,
|
scaledCharWidth,
|
||||||
scaledCharHeight,
|
scaledCharHeight,
|
||||||
fontFamily: terminal.options.fontFamily,
|
fontFamily: terminal.options.fontFamily,
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ export class WebglRenderer extends EventEmitter implements IRenderer {
|
|||||||
this._glyphRenderer.setDimensions(this.dimensions);
|
this._glyphRenderer.setDimensions(this.dimensions);
|
||||||
this._glyphRenderer.onResize();
|
this._glyphRenderer.onResize();
|
||||||
|
|
||||||
this._refreshCharAtlas(devicePixelRatio);
|
this._refreshCharAtlas();
|
||||||
this._refreshViewport();
|
this._refreshViewport();
|
||||||
|
|
||||||
this.emit('resize', {
|
this.emit('resize', {
|
||||||
@@ -219,12 +219,12 @@ export class WebglRenderer extends EventEmitter implements IRenderer {
|
|||||||
* @param terminal The terminal.
|
* @param terminal The terminal.
|
||||||
* @param colorSet The color set to use for the char atlas.
|
* @param colorSet The color set to use for the char atlas.
|
||||||
*/
|
*/
|
||||||
private _refreshCharAtlas(devicePixelRatio: number = window.devicePixelRatio): void {
|
private _refreshCharAtlas(): void {
|
||||||
if (this.dimensions.scaledCharWidth <= 0 && this.dimensions.scaledCharHeight <= 0) {
|
if (this.dimensions.scaledCharWidth <= 0 && this.dimensions.scaledCharHeight <= 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const atlas = acquireCharAtlas(this._terminal, this.colorManager.colors, this.dimensions.scaledCharWidth, this.dimensions.scaledCharHeight, devicePixelRatio);
|
const atlas = acquireCharAtlas(this._terminal, this.colorManager.colors, this.dimensions.scaledCharWidth, this.dimensions.scaledCharHeight);
|
||||||
if (!('getRasterizedGlyph' in atlas)) {
|
if (!('getRasterizedGlyph' in atlas)) {
|
||||||
throw new Error('The webgl renderer only works with the webgl char atlas');
|
throw new Error('The webgl renderer only works with the webgl char atlas');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user