Add overline style (attr bit 7)

cpsdqs/unified-input
cpsdqs 7 years ago
parent b18aca1438
commit ec4897ae2a
Signed by untrusted user: cpsdqs
GPG Key ID: 3F59586BB7448DD1
  1. 10
      jssrc/term_screen.js

@ -564,17 +564,19 @@ class TermScreen {
let underline = false;
let blink = false;
let strike = false;
let overline = false;
if (attrs & (1 << 1)) ctx.globalAlpha = 0.5;
if (attrs & (1 << 3)) underline = true;
if (attrs & (1 << 4)) blink = true;
if (attrs & (1 << 5)) text = TermScreen.alphaToFraktur(text);
if (attrs & (1 << 6)) strike = true;
if (attrs & (1 << 7)) overline = true;
if (!blink || this.window.blinkStyleOn) {
ctx.fillStyle = this.getColor(fg);
ctx.fillText(text, (x + 0.5) * cellWidth, (y + 0.5) * cellHeight);
if (underline || strike) {
if (underline || strike || overline) {
ctx.strokeStyle = this.getColor(fg);
ctx.lineWidth = 1;
ctx.lineCap = 'round';
@ -592,6 +594,12 @@ class TermScreen {
ctx.lineTo((x + 1) * cellWidth, lineY);
}
if (overline) {
let lineY = Math.round(y * cellHeight) + 0.5;
ctx.moveTo(x * cellWidth, lineY);
ctx.lineTo((x + 1) * cellWidth, lineY);
}
ctx.stroke();
}
}

Loading…
Cancel
Save