Bug 1713586. Move the clamping of the target zoom value in AsyncPanZoomController::ZoomToRect after some code which can change it. r=botond

This is a slight behaviour change but should be more correct.

Differential Revision: https://phabricator.services.mozilla.com/D116369
This commit is contained in:
Timothy Nikkel 2021-06-02 04:10:47 +00:00
Родитель b98af9b7f8
Коммит 0bd0d1de0d
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -5528,8 +5528,6 @@ void AsyncPanZoomController::ZoomToRect(const ZoomTarget& aZoomTarget,
targetZoom = localMinZoom;
}
targetZoom.scale =
clamped(targetZoom.scale, localMinZoom.scale, localMaxZoom.scale);
if (aFlags & PAN_INTO_VIEW_ONLY) {
targetZoom = currentZoom;
} else if (aFlags & ONLY_ZOOM_TO_DEFAULT_SCALE) {
@ -5546,6 +5544,9 @@ void AsyncPanZoomController::ZoomToRect(const ZoomTarget& aZoomTarget,
}
}
targetZoom.scale =
clamped(targetZoom.scale, localMinZoom.scale, localMaxZoom.scale);
FrameMetrics endZoomToMetrics = Metrics();
endZoomToMetrics.SetZoom(CSSToParentLayerScale2D(targetZoom));
CSSSize sizeAfterZoom =