Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1180)

Unified Diff: third_party/WebKit/Source/core/frame/LocalFrame.cpp

Issue 2387883002: Use float for scroll offset. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/frame/LocalFrame.cpp
diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.cpp b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
index 6f5347971b191cb4fefc79cb6e5990ff7c33e0e8..f03aeefbdebdbfc81721caa84f3d414dbd6eaec6 100644
--- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
@@ -631,11 +631,11 @@ void LocalFrame::setPageAndTextZoomFactors(float pageZoomFactor,
if (m_pageZoomFactor != pageZoomFactor) {
if (FrameView* view = this->view()) {
// Update the scroll position when doing a full page zoom, so the content stays in relatively the same position.
- LayoutPoint scrollPosition = view->scrollPosition();
+ ScrollOffset scrollOffset = view->scrollOffset();
float percentDifference = (pageZoomFactor / m_pageZoomFactor);
- view->setScrollPosition(
- DoublePoint(scrollPosition.x() * percentDifference,
- scrollPosition.y() * percentDifference),
+ view->setScrollOffset(
+ ScrollOffset(scrollOffset.width() * percentDifference,
+ scrollOffset.height() * percentDifference),
ProgrammaticScroll);
}
}

Powered by Google App Engine
This is Rietveld 408576698