diff options
author | crupest <crupest@outlook.com> | 2021-02-28 15:37:33 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-02-28 15:37:33 +0800 |
commit | a64ace1b09cb3c8594f510075ceffee17d8b7cfb (patch) | |
tree | 75a7a03f61d603faeaffc5c339c78a531599211e /src/ui/render/ScrollBar.cpp | |
parent | 38a5b9eddb75e07695ee38f0bd41d3fd76341a15 (diff) | |
download | cru-a64ace1b09cb3c8594f510075ceffee17d8b7cfb.tar.gz cru-a64ace1b09cb3c8594f510075ceffee17d8b7cfb.tar.bz2 cru-a64ace1b09cb3c8594f510075ceffee17d8b7cfb.zip |
...
Diffstat (limited to 'src/ui/render/ScrollBar.cpp')
-rw-r--r-- | src/ui/render/ScrollBar.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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<std::shared_ptr<platform::graphics::IBrush>> 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; } |