Bug 716403 - Resize viewport dynamically on Android. r=kats,mfinkle
This causes the viewport size to differ, depending on the length of the page. This has the effect of pages that size themselves to the size of the window always having the toolbar visible, making sites like Google Maps more usable.
This commit is contained in:
@@ -909,15 +909,21 @@ class JavaPanZoomController
|
||||
|
||||
// Ensure minZoomFactor keeps the page at least as big as the viewport.
|
||||
if (pageRect.width() > 0) {
|
||||
float scaleFactor = viewport.width() / pageRect.width();
|
||||
float pageWidth = pageRect.width() +
|
||||
viewportMetrics.fixedLayerMarginLeft +
|
||||
viewportMetrics.fixedLayerMarginRight;
|
||||
float scaleFactor = viewport.width() / pageWidth;
|
||||
minZoomFactor = Math.max(minZoomFactor, zoomFactor * scaleFactor);
|
||||
if (viewport.width() > pageRect.width())
|
||||
if (viewport.width() > pageWidth)
|
||||
focusX = 0.0f;
|
||||
}
|
||||
if (pageRect.height() > 0) {
|
||||
float scaleFactor = viewport.height() / pageRect.height();
|
||||
float pageHeight = pageRect.height() +
|
||||
viewportMetrics.fixedLayerMarginTop +
|
||||
viewportMetrics.fixedLayerMarginBottom;
|
||||
float scaleFactor = viewport.height() / pageHeight;
|
||||
minZoomFactor = Math.max(minZoomFactor, zoomFactor * scaleFactor);
|
||||
if (viewport.height() > pageRect.height())
|
||||
if (viewport.height() > pageHeight)
|
||||
focusY = 0.0f;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user