зеркало из https://github.com/mozilla/gecko-dev.git
Bug 901339 - Fix the focal point when zooming in and out. r=BenWa
This commit is contained in:
Родитель
272657d2b1
Коммит
4fe9002ec0
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче