From e22f03fac4fc1b0dd1874a2d8fef69c9220b52c9 Mon Sep 17 00:00:00 2001 From: "ccameron@chromium.org" Date: Tue, 20 Aug 2013 01:15:36 +0000 Subject: 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 --- cc/test/fake_scrollbar.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'cc/test/fake_scrollbar.h') diff --git a/cc/test/fake_scrollbar.h b/cc/test/fake_scrollbar.h index b9ac409..0f068b0 100644 --- a/cc/test/fake_scrollbar.h +++ b/cc/test/fake_scrollbar.h @@ -30,12 +30,20 @@ class FakeScrollbar : public Scrollbar { gfx::Rect content_rect) OVERRIDE; void set_location(gfx::Point location) { location_ = location; } + void set_track_rect(gfx::Rect track_rect) { track_rect_ = track_rect; } + void set_thumb_thickness(int thumb_thickness) { + thumb_thickness_ = thumb_thickness; + } + void set_thumb_length(int thumb_length) { thumb_length_ = thumb_length; } private: bool paint_; bool has_thumb_; bool is_overlay_; + int thumb_thickness_; + int thumb_length_; gfx::Point location_; + gfx::Rect track_rect_; SkColor fill_color_; DISALLOW_COPY_AND_ASSIGN(FakeScrollbar); -- cgit v1.1