Chromium Code Reviews| Index: Source/core/html/ImageDocument.cpp |
| diff --git a/Source/core/html/ImageDocument.cpp b/Source/core/html/ImageDocument.cpp |
| index f20e8d50eaffbd36cf4e5f78c6bed9eb545bdeee..d6819243d892548da29708a5c14a54c581edb19c 100644 |
| --- a/Source/core/html/ImageDocument.cpp |
| +++ b/Source/core/html/ImageDocument.cpp |
| @@ -266,10 +266,10 @@ void ImageDocument::imageClicked(int x, int y) |
| float scale = this->scale(); |
| - int scrollX = static_cast<int>(x / scale - (float)frame()->view()->width() / 2); |
| - int scrollY = static_cast<int>(y / scale - (float)frame()->view()->height() / 2); |
| + double scrollX = x / scale - (float)frame()->view()->width() / 2; |
|
Rick Byers
2014/10/02 21:44:05
use (double) instead of (float) to prevent loss of
Yufeng Shen (Slow to review)
2014/10/02 23:34:34
Done.
|
| + double scrollY = y / scale - (float)frame()->view()->height() / 2; |
| - frame()->view()->setScrollPosition(IntPoint(scrollX, scrollY)); |
| + frame()->view()->setScrollPosition(DoublePoint(scrollX, scrollY)); |
| } |
| } |