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

Unified Diff: third_party/WebKit/Source/core/events/MouseRelatedEvent.cpp

Issue 2387883002: Use float for scroll offset. (Closed)
Patch Set: Fix README.md 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/events/MouseRelatedEvent.cpp
diff --git a/third_party/WebKit/Source/core/events/MouseRelatedEvent.cpp b/third_party/WebKit/Source/core/events/MouseRelatedEvent.cpp
index fe3639beb7b7e6ea6b67be22258fa7f5ca807b82..935ba06d20465118128d0da2eb6aa0f630e4a4bc 100644
--- a/third_party/WebKit/Source/core/events/MouseRelatedEvent.cpp
+++ b/third_party/WebKit/Source/core/events/MouseRelatedEvent.cpp
@@ -74,24 +74,24 @@ MouseRelatedEvent::MouseRelatedEvent(
m_movementDelta(movementDelta),
m_positionType(positionType) {
LayoutPoint adjustedPageLocation;
- LayoutPoint scrollPosition;
+ LayoutSize scrollOffset;
LocalFrame* frame = view() && view()->isLocalDOMWindow()
? toLocalDOMWindow(view())->frame()
: nullptr;
if (frame && hasPosition()) {
if (FrameView* frameView = frame->view()) {
- scrollPosition = frameView->scrollPosition();
+ scrollOffset = LayoutSize(frameView->scrollOffsetInt());
adjustedPageLocation = frameView->rootFrameToContents(rootFrameLocation);
float scaleFactor = 1 / frame->pageZoomFactor();
if (scaleFactor != 1.0f) {
adjustedPageLocation.scale(scaleFactor, scaleFactor);
- scrollPosition.scale(scaleFactor, scaleFactor);
+ scrollOffset.scale(scaleFactor, scaleFactor);
}
}
}
- m_clientLocation = adjustedPageLocation - toLayoutSize(scrollPosition);
+ m_clientLocation = adjustedPageLocation - scrollOffset;
m_pageLocation = adjustedPageLocation;
// Set up initial values for coordinates.
« no previous file with comments | « third_party/WebKit/Source/core/dom/TreeScope.cpp ('k') | third_party/WebKit/Source/core/frame/DOMVisualViewport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698