line up vertically

This commit is contained in:
meganrogge
2021-08-10 13:41:24 -07:00
parent 3b8218e36e
commit ee759e245d
2 changed files with 23 additions and 19 deletions
+17 -18
View File
@@ -408,8 +408,8 @@ export abstract class BaseRenderLayer implements IRenderLayer {
return true; return true;
} }
const ops = boxDrawingLineSegments[char]; const lineSegments = boxDrawingLineSegments[char];
if (!ops) { if (!lineSegments) {
return false; return false;
} }
@@ -434,7 +434,7 @@ export abstract class BaseRenderLayer implements IRenderLayer {
xOffset + this._scaledCellWidth xOffset + this._scaledCellWidth
]; ];
const yPoints = [ const yPoints = [
yOffset, yOffset - 1,
yOffset + verticalCenter - scale * 2, yOffset + verticalCenter - scale * 2,
yOffset + verticalCenter - scale, yOffset + verticalCenter - scale,
yOffset + verticalCenter, yOffset + verticalCenter,
@@ -443,34 +443,33 @@ export abstract class BaseRenderLayer implements IRenderLayer {
yOffset + this._scaledCellHeight yOffset + this._scaledCellHeight
]; ];
for (let i = 0; i < ops.length; i++) { for (let i = 0; i < lineSegments.length; i++) {
const op = ops[i]; const line = lineSegments[i];
if (i === 0 || (op.x1 !== ops[i - 1].x2 || op.y1 !== ops[i - 1].y2)) { if (i === 0 || (line.x1 !== lineSegments[i - 1].x2 || line.y1 !== lineSegments[i - 1].y2)) {
this._ctx.beginPath(); this._ctx.beginPath();
if (this._ctx.lineWidth % 2 === 1) { if (this._ctx.lineWidth % 2 === 1) {
this._ctx.moveTo(line.x1 === 0 ? xPoints[line.x1] : xPoints[line.x1] + .5, yPoints[line.y1] + .5);
this._ctx.moveTo(op.x1 === 0 ? xPoints[op.x1] : xPoints[op.x1] + .5, yPoints[op.y1] + .5);
} else { } else {
this._ctx.moveTo(xPoints[op.x1], yPoints[op.y1]); this._ctx.moveTo(xPoints[line.x1], yPoints[line.y1]);
} }
} }
if (typeof op.cx1 !== 'undefined') { if (typeof line.cx1 !== 'undefined') {
// Draw curve // Draw curve
this._ctx.bezierCurveTo( this._ctx.bezierCurveTo(
xPoints[op.cx1], xPoints[line.cx1],
yPoints[op.cy1], yPoints[line.cy1],
xPoints[op.cx2], xPoints[line.cx2],
yPoints[op.cy2], yPoints[line.cy2],
xPoints[op.x2], xPoints[line.x2],
yPoints[op.y2]); yPoints[line.y2]);
} else { } else {
// Draw line // Draw line
if (this._ctx.lineWidth % 2 === 1) { if (this._ctx.lineWidth % 2 === 1) {
this._ctx.lineTo(op.x2 === 0 ? xPoints[op.x2] : xPoints[op.x2] + .5, yPoints[op.y2] + .5); this._ctx.lineTo(line.x2 === 0 ? xPoints[line.x2] : xPoints[line.x2] + .5, yPoints[line.y2] + .5);
} else { } else {
this._ctx.lineTo(xPoints[op.x2], yPoints[op.y2]); this._ctx.lineTo(xPoints[line.x2], yPoints[line.y2]);
} }
} }
+6 -1
View File
@@ -141,7 +141,12 @@ export abstract class CoreTerminal extends Disposable implements ICoreTerminal {
this.write('═ ║ ╒ ╓ ╔ ╕ ╖ ╗ ╘ ╙ ╚ ╛ ╜ ╝ ╞ ╟\r\n'); this.write('═ ║ ╒ ╓ ╔ ╕ ╖ ╗ ╘ ╙ ╚ ╛ ╜ ╝ ╞ ╟\r\n');
this.write('╠ ╡ ╢ ╣ ╤ ╥ ╦ ╧ ╨ ╩ ╪ ╫ ╬ ╭ ╮ ╯\r\n'); this.write('╠ ╡ ╢ ╣ ╤ ╥ ╦ ╧ ╨ ╩ ╪ ╫ ╬ ╭ ╮ ╯\r\n');
this.write('╰ ╱ ╲ ╳ ╴ ╵ ╶ ╷ ╸ ╹ ╺ ╻ ╼ ╽ ╾ ╿\r\n'); this.write('╰ ╱ ╲ ╳ ╴ ╵ ╶ ╷ ╸ ╹ ╺ ╻ ╼ ╽ ╾ ╿\r\n');
this.write('└─┐╘═╕╚═╕╗'); this.write('▇▇▇▇▇▇▇▇▇');
this.write(' ╔═════════════════════════════════════════════════════════╕\r\n');
this.write(' ║ │\r\n');
this.write(' ║ ╔═══════════════╦════════╤════════╗ │\r\n');
this.write(' ║ ║ ║ │ ║ │\r\n');
this.write(' ║ ║ ║ │ ║ │\r\n');
}, 1500); }, 1500);
} }