@@ -59,7 +59,6 @@ export class DecorationService extends Disposable implements IDecorationService
5959export class Decoration extends Disposable implements IDecoration {
6060 private readonly _marker : IMarker ;
6161 private _element : HTMLElement | undefined ;
62- private _altBufferActive : boolean = false ;
6362
6463 public isDisposed : boolean = false ;
6564
@@ -89,7 +88,6 @@ export class Decoration extends Disposable implements IDecoration {
8988 this . anchor = options . anchor || 'left' ;
9089 this . width = options . width || 1 ;
9190 this . height = options . height || 1 ;
92- this . register ( this . _bufferService . buffers . onBufferActivate ( ( event ) => this . _altBufferActive = event . activeBuffer === this . _bufferService . buffers . alt ) ) ;
9391 }
9492
9593 public render ( renderService : IRenderService , shouldRecreate ?: boolean ) : void {
@@ -111,18 +109,18 @@ export class Decoration extends Disposable implements IDecoration {
111109 }
112110 this . _element = document . createElement ( 'div' ) ;
113111 this . _element . classList . add ( 'xterm-decoration' ) ;
114- this . _element . style . width = `${ this . width * renderService . dimensions . scaledCellWidth } px` ;
115- this . _element . style . height = `${ this . height * renderService . dimensions . scaledCellHeight } px` ;
116- this . _element . style . top = `${ ( this . marker . line - this . _bufferService . buffers . active . ydisp ) * renderService . dimensions . scaledCellHeight } px` ;
112+ this . _element . style . width = `${ this . width * renderService . dimensions . actualCellWidth } px` ;
113+ this . _element . style . height = `${ this . height * renderService . dimensions . actualCellHeight } px` ;
114+ this . _element . style . top = `${ ( this . marker . line - this . _bufferService . buffers . active . ydisp ) * renderService . dimensions . actualCellHeight } px` ;
117115
118116 if ( this . x && this . x > this . _bufferService . cols ) {
119117 // exceeded the container width, so hide
120118 this . _element . style . display = 'none' ;
121119 }
122120 if ( this . anchor === 'right' ) {
123- this . _element . style . right = this . x ? `${ this . x * renderService . dimensions . scaledCellWidth } px` : '' ;
121+ this . _element . style . right = this . x ? `${ this . x * renderService . dimensions . actualCellWidth } px` : '' ;
124122 } else {
125- this . _element . style . left = this . x ? `${ this . x * renderService . dimensions . scaledCellWidth } px` : '' ;
123+ this . _element . style . left = this . x ? `${ this . x * renderService . dimensions . actualCellWidth } px` : '' ;
126124 }
127125 this . register ( {
128126 dispose : ( ) => {
@@ -152,8 +150,8 @@ export class Decoration extends Disposable implements IDecoration {
152150 // outside of viewport
153151 this . _element . style . display = 'none' ;
154152 } else {
155- this . _element . style . top = `${ line * renderService . dimensions . scaledCellHeight } px` ;
156- this . _element . style . display = this . _altBufferActive ? 'none' : 'block' ;
153+ this . _element . style . top = `${ line * renderService . dimensions . actualCellHeight } px` ;
154+ this . _element . style . display = this . _bufferService . buffer === this . _bufferService . buffers . alt ? 'none' : 'block' ;
157155 }
158156 }
159157}
0 commit comments