Merge pull request #2892 from Eugeny/fixed-dpr-listener
fixed ScreenDprListener never being fired
This commit is contained in:
@@ -44,12 +44,12 @@ export class ScreenDprMonitor extends Disposable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _updateDpr(): void {
|
private _updateDpr(): void {
|
||||||
if (!this._resolutionMediaMatchList || !this._outerListener) {
|
if (!this._outerListener) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear listeners for old DPR
|
// Clear listeners for old DPR
|
||||||
this._resolutionMediaMatchList.removeListener(this._outerListener);
|
this._resolutionMediaMatchList?.removeListener(this._outerListener);
|
||||||
|
|
||||||
// Add listeners for new DPR
|
// Add listeners for new DPR
|
||||||
this._currentDevicePixelRatio = window.devicePixelRatio;
|
this._currentDevicePixelRatio = window.devicePixelRatio;
|
||||||
|
|||||||
Reference in New Issue
Block a user