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

Unified Diff: cc/layers/layer_impl.cc

Issue 13079003: Fix solid color scrollbars for sublayers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
« no previous file with comments | « no previous file | cc/layers/scrollbar_layer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_impl.cc
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index 763a6968f21b49a176a03da65d0bbe3a407075a9..2ed76568c129b58bcd97bd9fce2e64a1a125cb28 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -800,15 +800,22 @@ void LayerImpl::CalculateContentsScale(
void LayerImpl::UpdateScrollbarPositions() {
gfx::Vector2dF current_offset = scroll_offset_ + scroll_delta_;
+ gfx::RectF viewport(PointAtOffsetFromOrigin(current_offset), bounds_);
+ gfx::SizeF scrollable_size(max_scroll_offset_.x() + bounds_.width(),
+ max_scroll_offset_.y() + bounds_.height());
if (horizontal_scrollbar_layer_) {
horizontal_scrollbar_layer_->SetCurrentPos(current_offset.x());
horizontal_scrollbar_layer_->SetTotalSize(bounds_.width());
horizontal_scrollbar_layer_->SetMaximum(max_scroll_offset_.x());
+ horizontal_scrollbar_layer_->SetViewportWithinScrollableArea(
+ viewport, scrollable_size);
}
if (vertical_scrollbar_layer_) {
vertical_scrollbar_layer_->SetCurrentPos(current_offset.y());
vertical_scrollbar_layer_->SetTotalSize(bounds_.height());
vertical_scrollbar_layer_->SetMaximum(max_scroll_offset_.y());
+ vertical_scrollbar_layer_->SetViewportWithinScrollableArea(
+ viewport, scrollable_size);
}
if (current_offset == last_scroll_offset_)
« no previous file with comments | « no previous file | cc/layers/scrollbar_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698