mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
Bug 1197824 - Constrain the min/max zoom if zooming is not allowed. r=botond
In the C++ APZ implementation this has no effect, because the min/max zoom values are never even read if zooming is not allowed. When this is hooked up to the Java implementation though, the code expects the min/max zoom values to be equal to the default zoom values in the case where zooming is not allowed. This behaviour change therefore facilitates hooking up the ZoomConstraintsClient to the Java pan/zoom controller implementation, which happens in a future patch. --HG-- extra : commitid : BYbR5yWXpjc
This commit is contained in:
parent
411981b8eb
commit
bd15a1287b
@ -153,8 +153,13 @@ ComputeZoomConstraintsFromViewportInfo(const nsViewportInfo& aViewportInfo)
|
||||
mozilla::layers::ZoomConstraints constraints;
|
||||
constraints.mAllowZoom = aViewportInfo.IsZoomAllowed() && gfxPrefs::APZAllowZooming();
|
||||
constraints.mAllowDoubleTapZoom = aViewportInfo.IsDoubleTapZoomAllowed() && gfxPrefs::APZAllowZooming();
|
||||
constraints.mMinZoom.scale = aViewportInfo.GetMinZoom().scale;
|
||||
constraints.mMaxZoom.scale = aViewportInfo.GetMaxZoom().scale;
|
||||
if (constraints.mAllowZoom) {
|
||||
constraints.mMinZoom.scale = aViewportInfo.GetMinZoom().scale;
|
||||
constraints.mMaxZoom.scale = aViewportInfo.GetMaxZoom().scale;
|
||||
} else {
|
||||
constraints.mMinZoom.scale = aViewportInfo.GetDefaultZoom().scale;
|
||||
constraints.mMaxZoom.scale = aViewportInfo.GetDefaultZoom().scale;
|
||||
}
|
||||
return constraints;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user