mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Fix initing of zoomLevel to NaN during slow page load.
This commit is contained in:
parent
544af1f196
commit
5f8fc47b99
@ -152,7 +152,8 @@ BrowserView.Util = {
|
||||
|
||||
clampZoomLevel: function clampZoomLevel(zl) {
|
||||
let bounded = Math.min(Math.max(kBrowserViewZoomLevelMin, zl), kBrowserViewZoomLevelMax);
|
||||
return Math.round(bounded * kBrowserViewZoomLevelPrecision) / kBrowserViewZoomLevelPrecision;
|
||||
let rounded = Math.round(bounded * kBrowserViewZoomLevelPrecision) / kBrowserViewZoomLevelPrecision;
|
||||
return (rounded) ? rounded : 1.0;
|
||||
},
|
||||
|
||||
pageZoomLevel: function pageZoomLevel(visibleRect, browserW, browserH) {
|
||||
|
@ -167,6 +167,7 @@ function onKeyPress(e) {
|
||||
const m = 109; // fix mouseout
|
||||
const r = 114; // reset visible rect
|
||||
const t = 116; // debug given list of tiles separated by space
|
||||
const z = 122; // set zoom level to 1
|
||||
|
||||
switch (e.charCode) {
|
||||
case r:
|
||||
@ -221,6 +222,9 @@ function onKeyPress(e) {
|
||||
case m:
|
||||
bv.resumeRendering();
|
||||
break;
|
||||
case z:
|
||||
bv.setZoomLevel(1.0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user