From a64ace1b09cb3c8594f510075ceffee17d8b7cfb Mon Sep 17 00:00:00 2001 From: crupest Date: Sun, 28 Feb 2021 15:37:33 +0800 Subject: ... --- src/ui/render/ScrollBar.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/ui/render/ScrollBar.cpp') diff --git a/src/ui/render/ScrollBar.cpp b/src/ui/render/ScrollBar.cpp index 00deb479..fa53292e 100644 --- a/src/ui/render/ScrollBar.cpp +++ b/src/ui/render/ScrollBar.cpp @@ -193,7 +193,7 @@ ScrollBar::GetExpandedArrowBrush() const { gsl::not_null> ScrollBar::GetExpandedArrowBackgroundBrush() const { // TODO: Read theme resource. - return expanded_arrow_brush_; + return expanded_arrow_background_brush_; } void ScrollBar::OnDraw(platform::graphics::IPainter* painter, @@ -357,8 +357,8 @@ float HorizontalScrollBar::CalculateNewScrollPosition( new_thumb_start = std::clamp(new_thumb_start, scroll_area_start, thumb_head_end); - auto offset = new_thumb_start / (scroll_area_end - scroll_area_start) * - child_size.width; + auto offset = (new_thumb_start - scroll_area_start) / + (scroll_area_end - scroll_area_start) * child_size.width; return offset; } @@ -482,8 +482,8 @@ float VerticalScrollBar::CalculateNewScrollPosition( new_thumb_start = std::clamp(new_thumb_start, scroll_area_start, thumb_head_end); - auto offset = new_thumb_start / (scroll_area_end - scroll_area_start) * - child_size.height; + auto offset = (new_thumb_start - scroll_area_start) / + (scroll_area_end - scroll_area_start) * child_size.width; return offset; } -- cgit v1.2.3