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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user