use window matchMedia.

This commit is contained in:
Miroslav Šedivý
2023-04-19 12:28:14 +02:00
parent f9417db520
commit 9b851aac61
3 changed files with 4 additions and 4 deletions

View File

@ -513,7 +513,7 @@
this.unsubscribePixelRatioChange()
}
const media = matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`)
const media = window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`)
media.addEventListener('change', this.onPixelRatioChange)
this.unsubscribePixelRatioChange = () => {
media.removeEventListener('change', this.onPixelRatioChange)