Bug 901339 - Fix the focal point when zooming in and out. r=BenWa

This commit is contained in:
Kartikaya Gupta 2013-08-07 12:34:16 -04:00
Родитель 272657d2b1
Коммит 4fe9002ec0
1 изменённых файлов: 4 добавлений и 3 удалений

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

@ -1155,12 +1155,13 @@ bool AsyncPanZoomController::SampleContentTransformForFrame(const TimeStamp& aSa
ViewTransform AsyncPanZoomController::GetCurrentAsyncTransform() {
ReentrantMonitorAutoEnter lock(mMonitor);
LayerPoint metricsScrollOffset;
CSSPoint lastPaintScrollOffset;
if (mLastContentPaintMetrics.IsScrollable()) {
metricsScrollOffset = mLastContentPaintMetrics.GetScrollOffsetInLayerPixels();
lastPaintScrollOffset = mLastContentPaintMetrics.mScrollOffset;
}
CSSToScreenScale localScale = mFrameMetrics.CalculateResolution();
LayerPoint translation = mFrameMetrics.GetScrollOffsetInLayerPixels() - metricsScrollOffset;
LayerPoint translation = (mFrameMetrics.mScrollOffset - lastPaintScrollOffset)
* mLastContentPaintMetrics.LayersPixelsPerCSSPixel();
return ViewTransform(-translation, localScale / mLastContentPaintMetrics.mDevPixelsPerCSSPixel);
}