Reduce diff with master

This commit is contained in:
Daniel Imms
2018-12-09 09:28:04 -08:00
parent 3d8b304af4
commit bb9ccf40b6
3 changed files with 7 additions and 8 deletions
+2 -3
View File
@@ -40,10 +40,9 @@ export function acquireCharAtlas(
terminal: ITerminal,
colors: IColorSet,
scaledCharWidth: number,
scaledCharHeight: number,
devicePixelRatio?: number
scaledCharHeight: number
): 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)
+2 -2
View File
@@ -7,7 +7,7 @@ import { ITerminal } from '../../Types';
import { IColorSet } 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
const clonedColors = <IColorSet>{
foreground: colors.foreground,
@@ -21,7 +21,7 @@ export function generateConfig(scaledCharWidth: number, scaledCharHeight: number
};
return {
type: terminal.options.experimentalCharAtlas,
devicePixelRatio,
devicePixelRatio: window.devicePixelRatio,
scaledCharWidth,
scaledCharHeight,
fontFamily: terminal.options.fontFamily,
+3 -3
View File
@@ -173,7 +173,7 @@ export class WebglRenderer extends EventEmitter implements IRenderer {
this._glyphRenderer.setDimensions(this.dimensions);
this._glyphRenderer.onResize();
this._refreshCharAtlas(devicePixelRatio);
this._refreshCharAtlas();
this._refreshViewport();
this.emit('resize', {
@@ -219,12 +219,12 @@ export class WebglRenderer extends EventEmitter implements IRenderer {
* @param terminal The terminal.
* @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) {
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)) {
throw new Error('The webgl renderer only works with the webgl char atlas');
}