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

Unified Diff: third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp

Issue 1672973002: ScrollableArea::pixelsPerLine should return viewport pixels in use-zoom-for-dsf mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/ScrollableArea.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp b/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp
index 6d5b7a1d6413667c0cf6b8b610cbe2324d75243e..1ddc3e7c2e6c48332b8b2ac4a6b84344ce7f13f3 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp
+++ b/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp
@@ -60,9 +60,12 @@ struct SameSizeAsScrollableArea {
static_assert(sizeof(ScrollableArea) == sizeof(SameSizeAsScrollableArea), "ScrollableArea should stay small");
-int ScrollableArea::pixelsPerLineStep()
+int ScrollableArea::pixelsPerLineStep(HostWindow* host)
{
- return kPixelsPerLineStep;
+ if (!host)
+ return kPixelsPerLineStep;
+ FloatRect tmpRectInViewport = host->windowToViewport(FloatRect(1, 0, 0, 0));
skobes 2016/02/09 23:42:32 Can we introduce a clearer API that doesn't use re
oshima 2016/02/16 06:09:53 I was asked to either made this symmetric to viewp
+ return kPixelsPerLineStep * tmpRectInViewport.x();
}
float ScrollableArea::minFractionToStepWhenPaging()
@@ -566,7 +569,7 @@ DoublePoint ScrollableArea::clampScrollPosition(const DoublePoint& scrollPositio
int ScrollableArea::lineStep(ScrollbarOrientation) const
{
- return pixelsPerLineStep();
+ return pixelsPerLineStep(hostWindow());
}
int ScrollableArea::pageStep(ScrollbarOrientation orientation) const
@@ -586,6 +589,8 @@ int ScrollableArea::documentStep(ScrollbarOrientation orientation) const
float ScrollableArea::pixelStep(ScrollbarOrientation) const
{
+ if (HostWindow* window = hostWindow())
+ return window->windowToViewport(FloatRect(1, 0, 0, 0)).x();
return 1;
}
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/ScrollableArea.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698