!48656 修复cache内ListItemGroup吸顶效果不生效问题

Merge pull request !48656 from wind/br2
This commit is contained in:
openharmony_ci 2024-11-16 05:36:54 +00:00 committed by Gitee
commit 93a8f17177
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -1141,12 +1141,10 @@ void ListItemGroupLayoutAlgorithm::LayoutHeaderFooterRTL(LayoutWrapper* layoutWr
UpdateZIndex(footerWrapper);
footerMainSize = footerWrapper->GetGeometryNode()->GetFrameSize().MainSize(axis_);
float footerPos = 0.0f;
if ((sticky == V2::StickyStyle::BOTH || sticky == V2::StickyStyle::FOOTER) && !itemPosition_.empty()) {
if (sticky == V2::StickyStyle::BOTH || sticky == V2::StickyStyle::FOOTER) {
contentStartOffset_ = std::max(contentStartOffset_, 0.0f);
float stickyPos = contentStartOffset_ - mainPos;
if (GetEndIndex() == totalItemCount_ - 1) {
stickyPos = std::min(stickyPos, GetEndPosition() - footerMainSize);
}
stickyPos = std::min(stickyPos, totalMainSize_ - footerMainSize_ - headerMainSize_);
footerPos = std::max(footerPos, stickyPos);
footerPos = std::min(footerPos, totalMainSize_ - footerMainSize_ - headerMainSize_);
}
@ -1189,12 +1187,10 @@ void ListItemGroupLayoutAlgorithm::LayoutHeaderFooterLTR(LayoutWrapper* layoutWr
UpdateZIndex(headerWrapper);
headerMainSize = headerWrapper->GetGeometryNode()->GetFrameSize().MainSize(axis_);
float headerPos = 0.0f;
if ((sticky == V2::StickyStyle::BOTH || sticky == V2::StickyStyle::HEADER) && !itemPosition_.empty()) {
if (sticky == V2::StickyStyle::BOTH || sticky == V2::StickyStyle::HEADER) {
contentStartOffset_ = std::max(contentStartOffset_, 0.0f);
float stickyPos = contentStartOffset_ - mainPos;
if (GetEndIndex() == totalItemCount_ - 1) {
stickyPos = std::min(stickyPos, GetEndPosition() - headerMainSize);
}
stickyPos = std::min(stickyPos, totalMainSize_ - footerMainSize_ - headerMainSize_);
headerPos = std::max(headerPos, stickyPos);
}
LayoutIndex(headerWrapper, paddingOffset, crossSize, headerPos);