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

Unified Diff: content/renderer/webscrollbarbehavior_impl_gtkoraura.cc

Issue 417053002: Ensure the scroll slop area is at least as large as it is by default on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/webscrollbarbehavior_impl_gtkoraura.cc
diff --git a/content/renderer/webscrollbarbehavior_impl_gtkoraura.cc b/content/renderer/webscrollbarbehavior_impl_gtkoraura.cc
index b866e29138fc2cc096147b072b3ea896516d19f3..8dfa99846be2ea1e889e5d1201a1395bea0ef2c3 100644
--- a/content/renderer/webscrollbarbehavior_impl_gtkoraura.cc
+++ b/content/renderer/webscrollbarbehavior_impl_gtkoraura.cc
@@ -31,11 +31,17 @@ bool WebScrollbarBehaviorImpl::shouldSnapBackToDragOrigin(
// guessing/extrapolation.
static const int kOffEndMultiplier = 3;
static const int kOffSideMultiplier = 8;
+ static const int kDefaultWinScrollbarThickness = 17;
// Find the rect within which we shouldn't snap, by expanding the track rect
// in both dimensions.
gfx::Rect noSnapRect(scrollbarRect);
- const int thickness = isHorizontal ? noSnapRect.height() : noSnapRect.width();
+ int thickness = isHorizontal ? noSnapRect.height() : noSnapRect.width();
+ // Even if the platform's scrollbar is narrower than the default Windows one,
+ // we still want to provide at least as much slop area, since a slightly
+ // narrower scrollbar doesn't necessarily imply that users will drag
+ // straighter.
+ thickness = std::max(thickness, kDefaultWinScrollbarThickness);
noSnapRect.Inset(
(isHorizontal ? kOffEndMultiplier : kOffSideMultiplier) * -thickness,
(isHorizontal ? kOffSideMultiplier : kOffEndMultiplier) * -thickness);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698