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

Unified Diff: cc/animation/scrollbar_animation_controller_thinning.cc

Issue 640063002: Hide scrollbars when their dimensions are not scrollable. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added unit tests Created 6 years, 2 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: cc/animation/scrollbar_animation_controller_thinning.cc
diff --git a/cc/animation/scrollbar_animation_controller_thinning.cc b/cc/animation/scrollbar_animation_controller_thinning.cc
index 0c05709c8c06e7985104aebb3cf9a36d4bf20af1..e95b5994ecf5a6d55daa1e864d795534807dc9a1 100644
--- a/cc/animation/scrollbar_animation_controller_thinning.cc
+++ b/cc/animation/scrollbar_animation_controller_thinning.cc
@@ -145,8 +145,12 @@ void ScrollbarAnimationControllerThinning::ApplyOpacityAndThumbThicknessScale(
++it) {
ScrollbarLayerImplBase* scrollbar = *it;
if (scrollbar->is_overlay_scrollbar()) {
- scrollbar->SetOpacity(
- AdjustScale(opacity, scrollbar->opacity(), opacity_change_));
+ float effectiveOpacity =
+ scrollbar->can_scroll_orientation()
+ ? AdjustScale(opacity, scrollbar->opacity(), opacity_change_)
+ : 0;
+
+ scrollbar->SetOpacity(effectiveOpacity);
scrollbar->SetThumbThicknessScaleFactor(
AdjustScale(thumb_thickness_scale,
scrollbar->thumb_thickness_scale_factor(),

Powered by Google App Engine
This is Rietveld 408576698