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

Unified Diff: third_party/WebKit/Source/core/events/MouseRelatedEvent.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/events/MouseRelatedEvent.cpp
diff --git a/third_party/WebKit/Source/core/events/MouseRelatedEvent.cpp b/third_party/WebKit/Source/core/events/MouseRelatedEvent.cpp
index 837bdd6b1edfad5faa3059dcb72fa0fede56b2f1..36aaeb9f05ec8d13476e4c31308ee159a2e6b2f3 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.

Powered by Google App Engine
This is Rietveld 408576698