update threshold for detecting zoom
This commit is contained in:
@@ -922,9 +922,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
const scrollBarWidth = 10;
|
const scrollBarWidth = 10;
|
||||||
const widthRatio =
|
const widthRatio =
|
||||||
(window.outerWidth - scrollBarWidth) / window.innerWidth;
|
(window.outerWidth - scrollBarWidth) / window.innerWidth;
|
||||||
const isBrowserZoomed =
|
const isBrowserZoomed = widthRatio < 0.75 || widthRatio > 1.1;
|
||||||
// Device pixel ratio is 2 when zoom is 100%
|
|
||||||
window.devicePixelRatio !== 2 || widthRatio < 0.9 || widthRatio > 1;
|
|
||||||
if (isBrowserZoomed) {
|
if (isBrowserZoomed) {
|
||||||
this.setToastMessage(t("alerts.browserZoom"));
|
this.setToastMessage(t("alerts.browserZoom"));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user