mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
@@ -439,8 +439,7 @@ export class WebglCharAtlas implements IDisposable {
|
||||
if (underline) {
|
||||
this._tmpCtx.save();
|
||||
const lineWidth = Math.max(1, Math.floor(this._config.fontSize * window.devicePixelRatio / 15));
|
||||
// When the width is odd, draw at 0.5 position. Offset by an additional 1 dpr to bring the
|
||||
// underline closer to the character
|
||||
// When the line width is odd, draw at a 0.5 position
|
||||
const yOffset = (lineWidth % 2 === 1 ? 0.5 : 0) + window.devicePixelRatio;
|
||||
this._tmpCtx.lineWidth = lineWidth;
|
||||
|
||||
@@ -463,9 +462,9 @@ export class WebglCharAtlas implements IDisposable {
|
||||
this._tmpCtx.beginPath();
|
||||
const xLeft = padding;
|
||||
const xRight = padding + this._config.scaledCellWidth;
|
||||
const yTop = Math.ceil(padding + this._config.scaledCharHeight - lineWidth) - yOffset;
|
||||
const yMid = padding + this._config.scaledCharHeight - yOffset;
|
||||
const yBot = Math.ceil(padding + this._config.scaledCharHeight + lineWidth) - yOffset;
|
||||
const yTop = Math.ceil(padding + this._config.scaledCharHeight) - yOffset;
|
||||
const yMid = padding + this._config.scaledCharHeight + lineWidth - yOffset;
|
||||
const yBot = Math.ceil(padding + this._config.scaledCharHeight + lineWidth * 2) - yOffset;
|
||||
switch (this._workAttributeData.extended.underlineStyle) {
|
||||
case UnderlineStyle.DOUBLE:
|
||||
this._tmpCtx.moveTo(xLeft, yTop);
|
||||
|
||||
Reference in New Issue
Block a user