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

Unified Diff: Source/platform/scroll/ScrollbarTheme.cpp

Issue 819953002: Mac: Update scrollbar size and input position during impl-overscroll (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Peure virtual Created 6 years 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 | « Source/platform/scroll/Scrollbar.cpp ('k') | Source/platform/scroll/ScrollbarThemeClient.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/scroll/ScrollbarTheme.cpp
diff --git a/Source/platform/scroll/ScrollbarTheme.cpp b/Source/platform/scroll/ScrollbarTheme.cpp
index a2f67d12e936f4080b7fefa0566e969e6abc80ed..77a44c2fa4e5e7e86b11c252b0c54cd45cba5d63 100644
--- a/Source/platform/scroll/ScrollbarTheme.cpp
+++ b/Source/platform/scroll/ScrollbarTheme.cpp
@@ -274,11 +274,17 @@ int ScrollbarTheme::thumbLength(ScrollbarThemeClient* scrollbar)
if (!scrollbar->enabled())
return 0;
+ // It is safe to compute the overhang by adding the result from the main
+ // thread overscroll mode (first) and then adding the result from compositor
+ // thread overscroll (second) because the modes are mutually exclusive (and
+ // determining which mode is in use here will require lots of temporary
+ // plumbing, and the main thread mode is to be deleted).
float overhang = 0;
if (scrollbar->currentPos() < 0)
overhang = -scrollbar->currentPos();
else if (scrollbar->visibleSize() + scrollbar->currentPos() > scrollbar->totalSize())
overhang = scrollbar->currentPos() + scrollbar->visibleSize() - scrollbar->totalSize();
+ overhang += fabsf(scrollbar->elasticOverscroll());
float proportion = 0.0f;
float totalSize = usedTotalSize(scrollbar);
if (totalSize > 0.0f) {
« no previous file with comments | « Source/platform/scroll/Scrollbar.cpp ('k') | Source/platform/scroll/ScrollbarThemeClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698