From 8f8b7dfd056dfa23dd1989d3f3dfd3d5d91d0168 Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Sat, 22 Nov 2025 21:24:18 +0800 Subject: Clean measure requirement codes. --- src/ui/render/ScrollBar.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/ui/render/ScrollBar.cpp') diff --git a/src/ui/render/ScrollBar.cpp b/src/ui/render/ScrollBar.cpp index 9e35cd30..8b2beac5 100644 --- a/src/ui/render/ScrollBar.cpp +++ b/src/ui/render/ScrollBar.cpp @@ -422,7 +422,7 @@ bool HorizontalScrollBar::IsShowBar() { if (child == nullptr) return false; const auto view_rect = render_object_->GetViewRect(); - const auto child_size = child->GetDesiredSize(); + const auto child_size = child->GetMeasureResultSize(); if (view_rect.width >= child_size.width) return false; @@ -439,7 +439,7 @@ std::optional HorizontalScrollBar::GetExpandedAreaRect( const auto child = render_object_->GetChild(); const auto view_rect = render_object_->GetViewRect(); - const auto child_size = child->GetDesiredSize(); + const auto child_size = child->GetMeasureResultSize(); const float start_percentage = view_rect.left / child_size.width; const float length_percentage = view_rect.width / child_size.width; @@ -491,7 +491,7 @@ std::optional HorizontalScrollBar::GetCollapsedThumbRect() { const auto child = render_object_->GetChild(); const auto view_rect = render_object_->GetViewRect(); - const auto child_size = child->GetDesiredSize(); + const auto child_size = child->GetMeasureResultSize(); const float start_percentage = view_rect.left / child_size.width; const float length_percentage = view_rect.width / child_size.width; @@ -517,7 +517,7 @@ float HorizontalScrollBar::CalculateNewScrollPosition( auto thumb_head_end = scroll_area_end - thumb_original_rect.width; const auto child = render_object_->GetChild(); - const auto child_size = child->GetDesiredSize(); + const auto child_size = child->GetMeasureResultSize(); new_thumb_start = std::clamp(new_thumb_start, scroll_area_start, thumb_head_end); @@ -570,7 +570,7 @@ bool VerticalScrollBar::IsShowBar() { if (child == nullptr) return false; const auto view_rect = render_object_->GetViewRect(); - const auto child_size = child->GetDesiredSize(); + const auto child_size = child->GetMeasureResultSize(); if (view_rect.height >= child_size.height) return false; @@ -587,7 +587,7 @@ std::optional VerticalScrollBar::GetExpandedAreaRect( const auto child = render_object_->GetChild(); const auto view_rect = render_object_->GetViewRect(); - const auto child_size = child->GetDesiredSize(); + const auto child_size = child->GetMeasureResultSize(); const float start_percentage = view_rect.top / child_size.height; const float length_percentage = view_rect.height / child_size.height; @@ -637,7 +637,7 @@ std::optional VerticalScrollBar::GetCollapsedThumbRect() { const auto view_rect = render_object_->GetViewRect(); const auto padding_rect = render_object_->GetPaddingRect(); - const auto child_size = child->GetDesiredSize(); + const auto child_size = child->GetMeasureResultSize(); if (view_rect.height >= child_size.height) return std::nullopt; @@ -663,7 +663,7 @@ float VerticalScrollBar::CalculateNewScrollPosition( auto thumb_head_end = scroll_area_end - thumb_original_rect.height; const auto child = render_object_->GetChild(); - const auto child_size = child->GetDesiredSize(); + const auto child_size = child->GetMeasureResultSize(); new_thumb_start = std::clamp(new_thumb_start, scroll_area_start, thumb_head_end); -- cgit v1.2.3