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

Unified Diff: third_party/WebKit/Source/core/html/ImageDocument.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/html/ImageDocument.cpp
diff --git a/third_party/WebKit/Source/core/html/ImageDocument.cpp b/third_party/WebKit/Source/core/html/ImageDocument.cpp
index d583a3dfd1a8f60efc3e554609c60b3e95f3d429..fbd45ecc7f12271702235af0f334d11ac0a1cc19 100644
--- a/third_party/WebKit/Source/core/html/ImageDocument.cpp
+++ b/third_party/WebKit/Source/core/html/ImageDocument.cpp
@@ -300,13 +300,13 @@ void ImageDocument::imageClicked(int x, int y) {
double scale = this->scale();
- double scrollX =
- x / scale - static_cast<double>(frame()->view()->width()) / 2;
- double scrollY =
- y / scale - static_cast<double>(frame()->view()->height()) / 2;
+ float scrollX =
+ x / scale - static_cast<float>(frame()->view()->width()) / 2;
+ float scrollY =
+ y / scale - static_cast<float>(frame()->view()->height()) / 2;
- frame()->view()->setScrollPosition(DoublePoint(scrollX, scrollY),
- ProgrammaticScroll);
+ frame()->view()->setScrollOffset(ScrollOffset(scrollX, scrollY),
+ ProgrammaticScroll);
}
}

Powered by Google App Engine
This is Rietveld 408576698