| 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 956f6179f26fca1058342b112263f8a39e258cd0..62b7dee0ad9c297f99d22a4826cdaf498ac21d96 100644
|
| --- a/cc/layers/scrollbar_layer_impl_base.cc
|
| +++ b/cc/layers/scrollbar_layer_impl_base.cc
|
| @@ -212,9 +212,13 @@ gfx::Rect ScrollbarLayerImplBase::ComputeThumbQuadRect() const {
|
| // With the length known, we can compute the thumb's position.
|
| float clamped_current_pos =
|
| std::min(std::max(current_pos_, 0.f), static_cast<float>(maximum_));
|
| - float ratio = clamped_current_pos / maximum_;
|
| - float max_offset = track_length - thumb_length;
|
| - int thumb_offset = static_cast<int>(ratio * max_offset) + TrackStart();
|
| +
|
| + int thumb_offset = TrackStart();
|
| + if (maximum_ > 0) {
|
| + float ratio = clamped_current_pos / maximum_;
|
| + float max_offset = track_length - thumb_length;
|
| + thumb_offset += static_cast<int>(ratio * max_offset);
|
| + }
|
|
|
| float thumb_thickness_adjustment =
|
| thumb_thickness * (1.f - thumb_thickness_scale_factor_);
|
|
|