diff options
author | ccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-20 01:15:36 +0000 |
---|---|---|
committer | ccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-20 01:15:36 +0000 |
commit | e22f03fac4fc1b0dd1874a2d8fef69c9220b52c9 (patch) | |
tree | 3093a956cf71e66f1fd81b529dc1f156eedb465f /cc/test/fake_scrollbar.cc | |
parent | 47203f336d91408ee2dfb9e3628ca1c42f8f2228 (diff) | |
download | chromium_src-e22f03fac4fc1b0dd1874a2d8fef69c9220b52c9.zip chromium_src-e22f03fac4fc1b0dd1874a2d8fef69c9220b52c9.tar.gz chromium_src-e22f03fac4fc1b0dd1874a2d8fef69c9220b52c9.tar.bz2 |
Correct computation of scrollbar track start
The track_start_ value should be the difference between where the track
starts and where the scrollbar starts. It was being set to the absolute
position where the track starts.
Add tests for ScrollbarLayerImpl::ComputeThumbQuadRect. Move syncing
geometry into a separate frunction from ScrollbarLayer::Update to
simplify tests.
BUG=271914
Review URL: https://chromiumcodereview.appspot.com/23007012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@218390 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test/fake_scrollbar.cc')
-rw-r--r-- | cc/test/fake_scrollbar.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/cc/test/fake_scrollbar.cc b/cc/test/fake_scrollbar.cc index e6b4253..67166f6 100644 --- a/cc/test/fake_scrollbar.cc +++ b/cc/test/fake_scrollbar.cc @@ -12,12 +12,18 @@ FakeScrollbar::FakeScrollbar() : paint_(false), has_thumb_(false), is_overlay_(false), + thumb_thickness_(10), + thumb_length_(5), + track_rect_(0, 0, 100, 10), fill_color_(SK_ColorGREEN) {} FakeScrollbar::FakeScrollbar(bool paint, bool has_thumb, bool is_overlay) : paint_(paint), has_thumb_(has_thumb), is_overlay_(is_overlay), + thumb_thickness_(10), + thumb_length_(5), + track_rect_(0, 0, 100, 10), fill_color_(SK_ColorGREEN) {} FakeScrollbar::~FakeScrollbar() {} @@ -33,15 +39,15 @@ bool FakeScrollbar::IsOverlay() const { return is_overlay_; } bool FakeScrollbar::HasThumb() const { return has_thumb_; } int FakeScrollbar::ThumbThickness() const { - return 10; + return thumb_thickness_; } int FakeScrollbar::ThumbLength() const { - return 10; + return thumb_length_; } gfx::Rect FakeScrollbar::TrackRect() const { - return gfx::Rect(0, 0, 100, 10); + return track_rect_; } void FakeScrollbar::PaintPart(SkCanvas* canvas, |