Merge from vscode 9bc92b48d945144abb405b9e8df05e18accb9148

This commit is contained in:
ADS Merger
2020-02-19 03:11:35 +00:00
parent 98584d32a7
commit 1e308639e5
253 changed files with 6414 additions and 2296 deletions
@@ -34,11 +34,13 @@ export class MinimapCharRenderer {
color: RGBA8,
backgroundColor: RGBA8,
fontScale: number,
useLighterFont: boolean
useLighterFont: boolean,
force1pxHeight: boolean
): void {
const charWidth = Constants.BASE_CHAR_WIDTH * this.scale;
const charHeight = Constants.BASE_CHAR_HEIGHT * this.scale;
if (dx + charWidth > target.width || dy + charHeight > target.height) {
const renderHeight = (force1pxHeight ? 1 : charHeight);
if (dx + charWidth > target.width || dy + renderHeight > target.height) {
console.warn('bad render request outside image data');
return;
}
@@ -60,7 +62,7 @@ export class MinimapCharRenderer {
let sourceOffset = charIndex * charWidth * charHeight;
let row = dy * destWidth + dx * Constants.RGBA_CHANNELS_CNT;
for (let y = 0; y < charHeight; y++) {
for (let y = 0; y < renderHeight; y++) {
let column = row;
for (let x = 0; x < charWidth; x++) {
const c = charData[sourceOffset++] / 255;
@@ -80,11 +82,13 @@ export class MinimapCharRenderer {
dy: number,
color: RGBA8,
backgroundColor: RGBA8,
useLighterFont: boolean
useLighterFont: boolean,
force1pxHeight: boolean
): void {
const charWidth = Constants.BASE_CHAR_WIDTH * this.scale;
const charHeight = Constants.BASE_CHAR_HEIGHT * this.scale;
if (dx + charWidth > target.width || dy + charHeight > target.height) {
const renderHeight = (force1pxHeight ? 1 : charHeight);
if (dx + charWidth > target.width || dy + renderHeight > target.height) {
console.warn('bad render request outside image data');
return;
}
@@ -108,7 +112,7 @@ export class MinimapCharRenderer {
const dest = target.data;
let row = dy * destWidth + dx * Constants.RGBA_CHANNELS_CNT;
for (let y = 0; y < charHeight; y++) {
for (let y = 0; y < renderHeight; y++) {
let column = row;
for (let x = 0; x < charWidth; x++) {
dest[column++] = colorR;