diff options
| author | Yuqian Yang <crupest@crupest.life> | 2025-11-22 21:24:18 +0800 |
|---|---|---|
| committer | Yuqian Yang <crupest@crupest.life> | 2025-11-22 21:24:18 +0800 |
| commit | 8f8b7dfd056dfa23dd1989d3f3dfd3d5d91d0168 (patch) | |
| tree | 435917530667bd4532c9bb70826c5796ca1ffa6a /src/ui/render/ScrollBar.cpp | |
| parent | 7ce185d5a3fcfad8c8f746f95f3d50a8829faac4 (diff) | |
| download | cru-8f8b7dfd056dfa23dd1989d3f3dfd3d5d91d0168.tar.gz cru-8f8b7dfd056dfa23dd1989d3f3dfd3d5d91d0168.tar.bz2 cru-8f8b7dfd056dfa23dd1989d3f3dfd3d5d91d0168.zip | |
Clean measure requirement codes.
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 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<Rect> 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<Rect> 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<Rect> 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<Rect> 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); |
