Polish all files (excl. CoreBrowserTerminal/Viewport)
This commit is contained in:
@@ -8,6 +8,10 @@ import { ICoreBrowserService, IRenderService, IThemeService } from 'browser/serv
|
||||
import { Disposable, toDisposable } from 'common/Lifecycle';
|
||||
import { IBufferService, IDecorationService, IOptionsService } from 'common/services/Services';
|
||||
|
||||
const enum Constants {
|
||||
OVERVIEW_RULER_BORDER_WIDTH = 1
|
||||
}
|
||||
|
||||
// Helper objects to avoid excessive calculation and garbage collection during rendering. These are
|
||||
// static values for each render and can be accessed using the decoration position as the key.
|
||||
const drawHeight = {
|
||||
@@ -98,8 +102,8 @@ export class OverviewRulerRenderer extends Disposable {
|
||||
|
||||
private _refreshDrawConstants(): void {
|
||||
// width
|
||||
const outerWidth = Math.floor((this._canvas.width - 1) / 3);
|
||||
const innerWidth = Math.ceil((this._canvas.width - 1) / 3);
|
||||
const outerWidth = Math.floor((this._canvas.width - Constants.OVERVIEW_RULER_BORDER_WIDTH) / 3);
|
||||
const innerWidth = Math.ceil((this._canvas.width - Constants.OVERVIEW_RULER_BORDER_WIDTH) / 3);
|
||||
drawWidth.full = this._canvas.width;
|
||||
drawWidth.left = outerWidth;
|
||||
drawWidth.center = innerWidth;
|
||||
@@ -107,10 +111,10 @@ export class OverviewRulerRenderer extends Disposable {
|
||||
// height
|
||||
this._refreshDrawHeightConstants();
|
||||
// x
|
||||
drawX.full = 1;
|
||||
drawX.left = 1;
|
||||
drawX.center = 1 + drawWidth.left;
|
||||
drawX.right = 1 + drawWidth.left + drawWidth.center;
|
||||
drawX.full = Constants.OVERVIEW_RULER_BORDER_WIDTH;
|
||||
drawX.left = Constants.OVERVIEW_RULER_BORDER_WIDTH;
|
||||
drawX.center = Constants.OVERVIEW_RULER_BORDER_WIDTH + drawWidth.left;
|
||||
drawX.right = Constants.OVERVIEW_RULER_BORDER_WIDTH + drawWidth.left + drawWidth.center;
|
||||
}
|
||||
|
||||
private _refreshDrawHeightConstants(): void {
|
||||
@@ -171,7 +175,7 @@ export class OverviewRulerRenderer extends Disposable {
|
||||
|
||||
private _renderRulerOutline(): void {
|
||||
this._ctx.fillStyle = this._themeService.colors.overviewRulerBorder.css;
|
||||
this._ctx.fillRect(0, 0, 1, this._canvas.height);
|
||||
this._ctx.fillRect(0, 0, Constants.OVERVIEW_RULER_BORDER_WIDTH, this._canvas.height);
|
||||
}
|
||||
|
||||
private _renderColorZone(zone: IColorZone): void {
|
||||
|
||||
@@ -23,12 +23,12 @@ interface IRestoreColorSet {
|
||||
const DEFAULT_FOREGROUND = css.toColor('#ffffff');
|
||||
const DEFAULT_BACKGROUND = css.toColor('#000000');
|
||||
const DEFAULT_CURSOR = css.toColor('#ffffff');
|
||||
const DEFAULT_CURSOR_ACCENT = css.toColor('#000000');
|
||||
const DEFAULT_CURSOR_ACCENT = DEFAULT_BACKGROUND;
|
||||
const DEFAULT_SELECTION = {
|
||||
css: 'rgba(255, 255, 255, 0.3)',
|
||||
rgba: 0xFFFFFF4D
|
||||
};
|
||||
const DEFAULT_OVERVIEW_RULER_BORDER = css.toColor('#000000');
|
||||
const DEFAULT_OVERVIEW_RULER_BORDER = DEFAULT_FOREGROUND;
|
||||
|
||||
export class ThemeService extends Disposable implements IThemeService {
|
||||
public serviceBrand: undefined;
|
||||
@@ -61,7 +61,7 @@ export class ThemeService extends Disposable implements IThemeService {
|
||||
scrollbarSliderBackground: color.opacity(DEFAULT_FOREGROUND, 0.2),
|
||||
scrollbarSliderHoverBackground: color.opacity(DEFAULT_FOREGROUND, 0.4),
|
||||
scrollbarSliderActiveBackground: color.opacity(DEFAULT_FOREGROUND, 0.5),
|
||||
overviewRulerBorder: DEFAULT_OVERVIEW_RULER_BORDER,
|
||||
overviewRulerBorder: DEFAULT_FOREGROUND,
|
||||
ansi: DEFAULT_ANSI_COLORS.slice(),
|
||||
contrastCache: this._contrastCache,
|
||||
halfContrastCache: this._halfContrastCache
|
||||
|
||||
Reference in New Issue
Block a user