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

Unified Diff: Source/core/frame/PinchViewport.cpp

Issue 610423004: Preserve fractional scroll offset for JS scrolling API (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 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
« no previous file with comments | « Source/core/frame/LocalFrame.cpp ('k') | Source/core/html/HTMLBodyElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/PinchViewport.cpp
diff --git a/Source/core/frame/PinchViewport.cpp b/Source/core/frame/PinchViewport.cpp
index 3c877332714d5e26b104395b96ea3ed1bfde8e5f..833be4479673c1ab27b75379c93267cf8935fbcd 100644
--- a/Source/core/frame/PinchViewport.cpp
+++ b/Source/core/frame/PinchViewport.cpp
@@ -136,14 +136,14 @@ void PinchViewport::scrollIntoView(const FloatRect& rect)
float centeringOffsetX = (visibleRect().width() - rect.width()) / 2;
float centeringOffsetY = (visibleRect().height() - rect.height()) / 2;
- FloatPoint targetOffset(
+ DoublePoint targetOffset(
rect.x() - centeringOffsetX - visibleRect().x(),
rect.y() - centeringOffsetY - visibleRect().y());
- view->setScrollPosition(flooredIntPoint(targetOffset));
+ view->setScrollPosition(targetOffset);
- FloatPoint remainder = FloatPoint(targetOffset - view->scrollPosition());
- move(remainder);
+ DoublePoint remainder = DoublePoint(targetOffset - view->scrollPositionDouble());
+ move(toFloatPoint(remainder));
}
void PinchViewport::setLocation(const FloatPoint& newLocation)
« no previous file with comments | « Source/core/frame/LocalFrame.cpp ('k') | Source/core/html/HTMLBodyElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698