Bug 1197824 - Stop propagating the default zoom around unnecessarily. r=snorp

The default zoom value is only used on the Java side to clamp the min/max zoom
values in the case where zooming is disabled. We can do this much earlier in
the flow, when we are computing the metadata, and reduce the amount of
redundant information being passed around.
This commit is contained in:
Kartikaya Gupta
2015-09-03 10:30:40 -04:00
parent 69d123473b
commit 756ac44b1b
3 changed files with 12 additions and 25 deletions

View File

@@ -1045,14 +1045,11 @@ class JavaPanZoomController
ZoomConstraints constraints = mTarget.getZoomConstraints();
if (constraints.getMinZoom() > 0)
if (constraints.getMinZoom() > 0 || !constraints.getAllowZoom()) {
minZoomFactor = constraints.getMinZoom();
if (constraints.getMaxZoom() > 0)
}
if (constraints.getMaxZoom() > 0 || !constraints.getAllowZoom()) {
maxZoomFactor = constraints.getMaxZoom();
if (!constraints.getAllowZoom()) {
// If allowZoom is false, clamp to the default zoom level.
maxZoomFactor = minZoomFactor = constraints.getDefaultZoom();
}
// Ensure minZoomFactor keeps the page at least as big as the viewport.