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

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

Issue 2763373002: Overlay scrollbars flush with window edge (Closed)
Patch Set: Created 3 years, 9 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/platform/scroll/ScrollbarThemeOverlay.cpp
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp b/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp
index 30ba2b9554699d95115ee07d6d3ed8f1506b2dd7..6898373b6088f859477b4a556fc7c92eb362d3b3 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp
+++ b/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp
@@ -65,7 +65,10 @@ bool ScrollbarThemeOverlay::shouldRepaintAllPartsOnInvalidation() const {
ScrollbarPart ScrollbarThemeOverlay::invalidateOnThumbPositionChange(
const ScrollbarThemeClient&,
float oldPosition,
- float newPosition) const {
+ float newPosition,
+ bool hitBeginOrEndChanged) const {
+ if (hitBeginOrEndChanged)
+ return ThumbPart;
return NoPart;
}
@@ -204,6 +207,17 @@ void ScrollbarThemeOverlay::paintThumb(GraphicsContext& context,
params.scrollbarThumb.scrollbarTheme =
static_cast<WebScrollbarOverlayColorTheme>(
scrollbar.getScrollbarOverlayColorTheme());
+ params.scrollbarThumb.isVerticalScrollbar =
+ scrollbar.orientation() == VerticalScrollbar;
+ params.scrollbarThumb.isLeftVerticalScrollbar =
+ scrollbar.isLeftSideVerticalScrollbar();
+
+ int currentThumbPosition = ScrollbarTheme::thumbPosition(scrollbar);
+
+ params.scrollbarThumb.hitStart = currentThumbPosition == 0;
+ params.scrollbarThumb.hitEnd =
+ !scrollbar.hasScrollCorner() &&
+ currentThumbPosition + thumbLength(scrollbar) == trackLength(scrollbar);
Platform::current()->themeEngine()->paint(canvas, part, state, WebRect(rect),
&params);

Powered by Google App Engine
This is Rietveld 408576698