diff options
Diffstat (limited to 'src/ui/render/ScrollBar.cpp')
-rw-r--r-- | src/ui/render/ScrollBar.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/ui/render/ScrollBar.cpp b/src/ui/render/ScrollBar.cpp index e3cc006b..e6389e16 100644 --- a/src/ui/render/ScrollBar.cpp +++ b/src/ui/render/ScrollBar.cpp @@ -452,7 +452,7 @@ bool HorizontalScrollBar::IsShowBar() { if (child == nullptr) return false; const auto view_rect = render_object_->GetViewRect(); - const auto child_size = child->GetSize(); + const auto child_size = child->GetDesiredSize(); if (view_rect.width >= child_size.width) return false; @@ -469,7 +469,7 @@ std::optional<Rect> HorizontalScrollBar::GetExpandedAreaRect( const auto child = render_object_->GetFirstChild(); const auto view_rect = render_object_->GetViewRect(); - const auto child_size = child->GetSize(); + const auto child_size = child->GetDesiredSize(); const float start_percentage = view_rect.left / child_size.width; const float length_percentage = view_rect.width / child_size.width; @@ -521,7 +521,7 @@ std::optional<Rect> HorizontalScrollBar::GetCollapsedThumbRect() { const auto child = render_object_->GetFirstChild(); const auto view_rect = render_object_->GetViewRect(); - const auto child_size = child->GetSize(); + const auto child_size = child->GetDesiredSize(); const float start_percentage = view_rect.left / child_size.width; const float length_percentage = view_rect.width / child_size.width; @@ -547,7 +547,7 @@ float HorizontalScrollBar::CalculateNewScrollPosition( auto thumb_head_end = scroll_area_end - thumb_original_rect.width; const auto child = render_object_->GetFirstChild(); - const auto child_size = child->GetSize(); + const auto child_size = child->GetDesiredSize(); new_thumb_start = std::clamp(new_thumb_start, scroll_area_start, thumb_head_end); @@ -601,7 +601,7 @@ bool VerticalScrollBar::IsShowBar() { if (child == nullptr) return false; const auto view_rect = render_object_->GetViewRect(); - const auto child_size = child->GetSize(); + const auto child_size = child->GetDesiredSize(); if (view_rect.height >= child_size.height) return false; @@ -618,7 +618,7 @@ std::optional<Rect> VerticalScrollBar::GetExpandedAreaRect( const auto child = render_object_->GetFirstChild(); const auto view_rect = render_object_->GetViewRect(); - const auto child_size = child->GetSize(); + const auto child_size = child->GetDesiredSize(); const float start_percentage = view_rect.top / child_size.height; const float length_percentage = view_rect.height / child_size.height; @@ -668,7 +668,7 @@ std::optional<Rect> VerticalScrollBar::GetCollapsedThumbRect() { const auto view_rect = render_object_->GetViewRect(); const auto padding_rect = render_object_->GetPaddingRect(); - const auto child_size = child->GetSize(); + const auto child_size = child->GetDesiredSize(); if (view_rect.height >= child_size.height) return std::nullopt; @@ -694,7 +694,7 @@ float VerticalScrollBar::CalculateNewScrollPosition( auto thumb_head_end = scroll_area_end - thumb_original_rect.height; const auto child = render_object_->GetFirstChild(); - const auto child_size = child->GetSize(); + const auto child_size = child->GetDesiredSize(); new_thumb_start = std::clamp(new_thumb_start, scroll_area_start, thumb_head_end); |