зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1511375 - Update the visual viewport size in UpdateResolution() if either the zoom or the display size might have changed. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D13578 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
1ca919f882
Коммит
cad1533d02
|
@ -329,15 +329,19 @@ void MobileViewportManager::UpdateResolution(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the zoom has changed, update the pres shell resolution and the
|
// If the zoom has changed, update the pres shell resolution accordingly.
|
||||||
// visual viewport size accordingly.
|
|
||||||
if (newZoom) {
|
if (newZoom) {
|
||||||
LayoutDeviceToLayerScale resolution = ZoomToResolution(*newZoom, cssToDev);
|
LayoutDeviceToLayerScale resolution = ZoomToResolution(*newZoom, cssToDev);
|
||||||
MVM_LOG("%p: setting resolution %f\n", this, resolution.scale);
|
MVM_LOG("%p: setting resolution %f\n", this, resolution.scale);
|
||||||
mPresShell->SetResolutionAndScaleTo(resolution.scale);
|
mPresShell->SetResolutionAndScaleTo(resolution.scale);
|
||||||
|
|
||||||
MVM_LOG("%p: New zoom is %f\n", this, newZoom->scale);
|
MVM_LOG("%p: New zoom is %f\n", this, newZoom->scale);
|
||||||
UpdateVisualViewportSize(aDisplaySize, *newZoom);
|
}
|
||||||
|
|
||||||
|
// The visual viewport size depends on both the zoom and the display size,
|
||||||
|
// and needs to be updated if either might have changed.
|
||||||
|
if (newZoom || aType == UpdateType::ViewportSize) {
|
||||||
|
UpdateVisualViewportSize(aDisplaySize, newZoom ? *newZoom : zoom);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче