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

Unified Diff: third_party/WebKit/Source/core/events/MouseRelatedEvent.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/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..234b35327b20f23311b3f09c7def2e79b9ff830b 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;
+ LayoutPoint scrollOffset;
bokan 2016/10/02 19:47:50 Make this LayoutSize to avoid casts below.
szager1 2016/10/05 07:43:36 Done.
LocalFrame* frame = view() && view()->isLocalDOMWindow()
? toLocalDOMWindow(view())->frame()
: nullptr;
if (frame && hasPosition()) {
if (FrameView* frameView = frame->view()) {
- scrollPosition = frameView->scrollPosition();
+ scrollOffset = LayoutPoint(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 - toLayoutSize(scrollOffset);
m_pageLocation = adjustedPageLocation;
// Set up initial values for coordinates.

Powered by Google App Engine
This is Rietveld 408576698