mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Merge pull request #2228 from Tyriar/fix_dpr_change
Fix screen dpr change not refreshing canvas renderer
This commit is contained in:
@@ -43,7 +43,7 @@ export class RenderService extends Disposable implements IRenderService {
|
||||
this.register(this._renderDebouncer);
|
||||
|
||||
this._screenDprMonitor = new ScreenDprMonitor();
|
||||
this._screenDprMonitor.setListener(() => this._renderer.onDevicePixelRatioChange());
|
||||
this._screenDprMonitor.setListener(() => this.onDevicePixelRatioChange());
|
||||
this.register(this._screenDprMonitor);
|
||||
|
||||
this.register(optionsService.onOptionChange(() => this._renderer.onOptionsChanged()));
|
||||
@@ -51,7 +51,7 @@ export class RenderService extends Disposable implements IRenderService {
|
||||
|
||||
// dprchange should handle this case, we need this as well for browsers that don't support the
|
||||
// matchMedia query.
|
||||
this.register(addDisposableDomListener(window, 'resize', () => this._renderer.onDevicePixelRatioChange()));
|
||||
this.register(addDisposableDomListener(window, 'resize', () => this.onDevicePixelRatioChange()));
|
||||
|
||||
// Detect whether IntersectionObserver is detected and enable renderer pause
|
||||
// and resume based on terminal visibility if so
|
||||
@@ -122,6 +122,7 @@ export class RenderService extends Disposable implements IRenderService {
|
||||
|
||||
public onDevicePixelRatioChange(): void {
|
||||
this._renderer.onDevicePixelRatioChange();
|
||||
this.refreshRows(0, this._rowCount);
|
||||
}
|
||||
|
||||
public onResize(cols: number, rows: number): void {
|
||||
|
||||
Reference in New Issue
Block a user