mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Fix powerlines not clipped when bg changes
This commit is contained in:
@@ -203,10 +203,11 @@ export class GlyphRenderer extends Disposable {
|
||||
return;
|
||||
}
|
||||
|
||||
if (bg !== lastBg && rasterizedGlyph.offset.x > 0) {
|
||||
const clippedPixels = rasterizedGlyph.offset.x;
|
||||
const leftCellPadding = Math.floor((this._dimensions.scaledCellWidth - this._dimensions.scaledCharWidth) / 2);
|
||||
if (bg !== lastBg && rasterizedGlyph.offset.x > leftCellPadding) {
|
||||
const clippedPixels = rasterizedGlyph.offset.x - leftCellPadding;
|
||||
// a_origin
|
||||
array[i ] = this._dimensions.scaledCharLeft;
|
||||
array[i ] = -(rasterizedGlyph.offset.x - clippedPixels) + this._dimensions.scaledCharLeft;
|
||||
array[i + 1] = -rasterizedGlyph.offset.y + this._dimensions.scaledCharTop;
|
||||
// a_size
|
||||
array[i + 2] = (rasterizedGlyph.size.x - clippedPixels) / this._dimensions.scaledCanvasWidth;
|
||||
|
||||
@@ -604,9 +604,6 @@ export class WebglCharAtlas implements IDisposable {
|
||||
}
|
||||
|
||||
const rasterizedGlyph = this._findGlyphBoundingBox(imageData, this._workBoundingBox, allowedWidth, powerlineGlyph, customGlyph, padding);
|
||||
if (powerlineGlyph) {
|
||||
console.log(`powerline glyph ${chars}`, rasterizedGlyph, this._workBoundingBox);
|
||||
}
|
||||
const clippedImageData = this._clipImageData(imageData, this._workBoundingBox);
|
||||
|
||||
// Find the best atlas row to use
|
||||
@@ -758,7 +755,7 @@ export class WebglCharAtlas implements IDisposable {
|
||||
y: (boundingBox.bottom - boundingBox.top + 1) / TEXTURE_HEIGHT
|
||||
},
|
||||
offset: {
|
||||
x: -boundingBox.left + padding + ((restrictedGlyph || customGlyph) ? Math.round((this._config.scaledCellWidth - this._config.scaledCharWidth) / 2) : 0),
|
||||
x: -boundingBox.left + padding + ((restrictedGlyph || customGlyph) ? Math.floor((this._config.scaledCellWidth - this._config.scaledCharWidth) / 2) : 0),
|
||||
y: -boundingBox.top + padding + ((restrictedGlyph || customGlyph) ? this._config.lineHeight === 1 ? 0 : Math.round((this._config.scaledCellHeight - this._config.scaledCharHeight) / 2) : 0)
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user