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

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

Issue 2387883002: Use float for scroll offset. (Closed)
Patch Set: tweaks and docs 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 abd6e8f63e13730ed35330d38dd3ae56f6ea984b..b1cdaac3e46bb9afba083490e3f4fc6cb98275ce 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