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

Unified Diff: cc/layers/scrollbar_layer_impl_base.cc

Issue 2841943002: Overlay scrollbars expand only when mouse is near thumb (Closed)
Patch Set: weiliangc comment addressed Created 3 years, 8 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 | « cc/layers/scrollbar_layer_impl_base.h ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/scrollbar_layer_impl_base.cc
diff --git a/cc/layers/scrollbar_layer_impl_base.cc b/cc/layers/scrollbar_layer_impl_base.cc
index 839c0b7f927d488f9ce76813ebd40b7abf66569f..640a26e208d9de6e50587224afa0dfc7964094f4 100644
--- a/cc/layers/scrollbar_layer_impl_base.cc
+++ b/cc/layers/scrollbar_layer_impl_base.cc
@@ -107,7 +107,8 @@ bool ScrollbarLayerImplBase::SetThumbThicknessScaleFactor(float factor) {
return true;
}
-gfx::Rect ScrollbarLayerImplBase::ComputeThumbQuadRect() const {
+gfx::Rect ScrollbarLayerImplBase::ComputeThumbQuadRectWithThumbThicknessScale(
+ float thumb_thickness_scale_factor) const {
// Thumb extent is the length of the thumb in the scrolling direction, thumb
// thickness is in the perpendicular direction. Here's an example of a
// horizontal scrollbar - inputs are above the scrollbar, computed values
@@ -185,7 +186,7 @@ gfx::Rect ScrollbarLayerImplBase::ComputeThumbQuadRect() const {
}
float thumb_thickness_adjustment =
- thumb_thickness * (1.f - thumb_thickness_scale_factor_);
+ thumb_thickness * (1.f - thumb_thickness_scale_factor);
gfx::RectF thumb_rect;
if (orientation_ == HORIZONTAL) {
@@ -206,6 +207,16 @@ gfx::Rect ScrollbarLayerImplBase::ComputeThumbQuadRect() const {
return gfx::ToEnclosingRect(thumb_rect);
}
+gfx::Rect ScrollbarLayerImplBase::ComputeExpandedThumbQuadRect() const {
+ DCHECK(is_overlay_scrollbar());
+ return ComputeThumbQuadRectWithThumbThicknessScale(1.f);
+}
+
+gfx::Rect ScrollbarLayerImplBase::ComputeThumbQuadRect() const {
+ return ComputeThumbQuadRectWithThumbThicknessScale(
+ thumb_thickness_scale_factor_);
+}
+
void ScrollbarLayerImplBase::SetOverlayScrollbarLayerOpacityAnimated(
float opacity) {
DCHECK(is_overlay_scrollbar());
« no previous file with comments | « cc/layers/scrollbar_layer_impl_base.h ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698