Merge remote-tracking branch 'origin/webgl2' into pr/juancampa/6-1
This commit is contained in:
@@ -104,7 +104,7 @@ export class ColorManager implements IColorManager {
|
||||
}
|
||||
|
||||
// Coefficients taken from: https://www.w3.org/TR/AERT/#color-contrast
|
||||
public getLuminance(color: IColor) : number {
|
||||
public getLuminance(color: IColor): number {
|
||||
const r = color.rgba >> 24 & 0xff;
|
||||
const g = color.rgba >> 16 & 0xff;
|
||||
const b = color.rgba >> 8 & 0xff;
|
||||
|
||||
@@ -70,7 +70,7 @@ export class Renderer extends EventEmitter implements IRenderer {
|
||||
// Detect whether IntersectionObserver is detected and enable renderer pause
|
||||
// and resume based on terminal visibility if so
|
||||
if ('IntersectionObserver' in window) {
|
||||
const observer = new IntersectionObserver(e => this.onIntersectionChange(e[0]), { threshold: 0 });
|
||||
const observer = new IntersectionObserver(e => this.onIntersectionChange(e[e.length - 1]), { threshold: 0 });
|
||||
observer.observe(this._terminal.element);
|
||||
this.register({ dispose: () => observer.disconnect() });
|
||||
}
|
||||
|
||||
@@ -55,6 +55,7 @@ export class SelectionRenderLayer extends BaseRenderLayer {
|
||||
|
||||
// Selection does not exist
|
||||
if (!start || !end) {
|
||||
this._clearState();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -215,7 +215,7 @@ export class GlyphRenderer {
|
||||
|
||||
// TODO: Make fg and bg configurable, currently since the buffer doesn't
|
||||
// support truecolor the char atlas cannot store it.
|
||||
const lumi = this._colorManager.getLuminance(this._colorManager.colors.background)
|
||||
const lumi = this._colorManager.getLuminance(this._colorManager.colors.background);
|
||||
const fg = lumi > 0.5 ? 7 : 0;
|
||||
const bg = lumi > 0.5 ? 0 : 7;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user