From 8f4d132bf3b1d33bdadd0e76ae398b8812a4d432 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Thu, 5 Dec 2013 16:15:39 +0100 Subject: [PATCH] Bug 938312 - Wrong orientation when starting browser in landscape mode. r=kats --- gfx/layers/ipc/AsyncPanZoomController.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gfx/layers/ipc/AsyncPanZoomController.cpp b/gfx/layers/ipc/AsyncPanZoomController.cpp index 100d9bcb6ac..bd524b874a8 100644 --- a/gfx/layers/ipc/AsyncPanZoomController.cpp +++ b/gfx/layers/ipc/AsyncPanZoomController.cpp @@ -1418,7 +1418,9 @@ void AsyncPanZoomController::UpdateCompositionBounds(const ScreenIntRect& aCompo if (aCompositionBounds.width && aCompositionBounds.height && oldCompositionBounds.width && oldCompositionBounds.height) { float adjustmentFactor = float(aCompositionBounds.width) / float(oldCompositionBounds.width); - mFrameMetrics.mZoom.scale *= adjustmentFactor; + mFrameMetrics.mZoom.scale = + clamped(mFrameMetrics.mZoom.scale * adjustmentFactor, + mMinZoom.scale, mMaxZoom.scale); // Repaint on a rotation so that our new resolution gets properly updated. RequestContentRepaint();