Use opaque selection in webgl, fix selection default rgba
This commit is contained in:
@@ -218,7 +218,7 @@ export class GlyphRenderer {
|
|||||||
|
|
||||||
this._vertices.selectionAttributes = slice(this._vertices.attributes, 0);
|
this._vertices.selectionAttributes = slice(this._vertices.attributes, 0);
|
||||||
|
|
||||||
const bg = (this._colors.selection.rgba >>> 8) | Attributes.CM_RGB;
|
const bg = (this._colors.selectionOpaque.rgba >>> 8) | Attributes.CM_RGB;
|
||||||
|
|
||||||
if (columnSelectMode) {
|
if (columnSelectMode) {
|
||||||
const startCol = model.selection.startCol;
|
const startCol = model.selection.startCol;
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ export class RectangleRenderer {
|
|||||||
|
|
||||||
private _updateCachedColors(): void {
|
private _updateCachedColors(): void {
|
||||||
this._bgFloat = this._colorToFloat32Array(this._colors.background);
|
this._bgFloat = this._colorToFloat32Array(this._colors.background);
|
||||||
this._selectionFloat = this._colorToFloat32Array(this._colors.selection);
|
this._selectionFloat = this._colorToFloat32Array(this._colors.selectionOpaque);
|
||||||
}
|
}
|
||||||
|
|
||||||
private _updateViewportRectangle(): void {
|
private _updateViewportRectangle(): void {
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) 2019 The xterm.js authors. All rights reserved.
|
||||||
|
* @license MIT
|
||||||
|
*/
|
||||||
|
|
||||||
import { IColor } from './Types';
|
import { IColor } from './Types';
|
||||||
|
|
||||||
export function blend(bg: IColor, fg: IColor): IColor {
|
export function blend(bg: IColor, fg: IColor): IColor {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ const DEFAULT_CURSOR = fromCss('#ffffff');
|
|||||||
const DEFAULT_CURSOR_ACCENT = fromCss('#000000');
|
const DEFAULT_CURSOR_ACCENT = fromCss('#000000');
|
||||||
const DEFAULT_SELECTION = {
|
const DEFAULT_SELECTION = {
|
||||||
css: 'rgba(255, 255, 255, 0.3)',
|
css: 'rgba(255, 255, 255, 0.3)',
|
||||||
rgba: 0xFFFFFF77
|
rgba: 0xFFFFFF4D
|
||||||
};
|
};
|
||||||
|
|
||||||
// An IIFE to generate DEFAULT_ANSI_COLORS. Do not mutate DEFAULT_ANSI_COLORS, instead make a copy
|
// An IIFE to generate DEFAULT_ANSI_COLORS. Do not mutate DEFAULT_ANSI_COLORS, instead make a copy
|
||||||
@@ -108,6 +108,7 @@ export class ColorManager implements IColorManager {
|
|||||||
this.colors.cursor = this._parseColor(theme.cursor, DEFAULT_CURSOR, true);
|
this.colors.cursor = this._parseColor(theme.cursor, DEFAULT_CURSOR, true);
|
||||||
this.colors.cursorAccent = this._parseColor(theme.cursorAccent, DEFAULT_CURSOR_ACCENT, true);
|
this.colors.cursorAccent = this._parseColor(theme.cursorAccent, DEFAULT_CURSOR_ACCENT, true);
|
||||||
this.colors.selection = this._parseColor(theme.selection, DEFAULT_SELECTION, true);
|
this.colors.selection = this._parseColor(theme.selection, DEFAULT_SELECTION, true);
|
||||||
|
this.colors.selectionOpaque = blend(this.colors.background, this.colors.selection);
|
||||||
this.colors.ansi[0] = this._parseColor(theme.black, DEFAULT_ANSI_COLORS[0]);
|
this.colors.ansi[0] = this._parseColor(theme.black, DEFAULT_ANSI_COLORS[0]);
|
||||||
this.colors.ansi[1] = this._parseColor(theme.red, DEFAULT_ANSI_COLORS[1]);
|
this.colors.ansi[1] = this._parseColor(theme.red, DEFAULT_ANSI_COLORS[1]);
|
||||||
this.colors.ansi[2] = this._parseColor(theme.green, DEFAULT_ANSI_COLORS[2]);
|
this.colors.ansi[2] = this._parseColor(theme.green, DEFAULT_ANSI_COLORS[2]);
|
||||||
|
|||||||
Reference in New Issue
Block a user