mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-23 07:01:24 +00:00
回退 'Pull Request !44389 : 修复Swiper非循环时,ForEach缓存节点范围计算错误问题'
This commit is contained in:
parent
1d40417e56
commit
d15a504140
@ -4507,12 +4507,6 @@ void SwiperPattern::SetLazyLoadFeature(bool useLazyLoad)
|
||||
auto cacheCount = std::min(GetCachedCount(), RealTotalCount());
|
||||
std::set<int32_t> forEachIndexSet;
|
||||
for (auto count = 1; count <= cacheCount; count++) {
|
||||
if (!IsLoop()) {
|
||||
forEachIndexSet.emplace(std::min(GetLoopIndex(currentIndex_) + count, TotalCount() - 1));
|
||||
forEachIndexSet.emplace(std::max(GetLoopIndex(currentIndex_) - count, 0));
|
||||
continue;
|
||||
}
|
||||
|
||||
forEachIndexSet.emplace(GetLoopIndex(currentIndex_ + count));
|
||||
forEachIndexSet.emplace(GetLoopIndex(currentIndex_ - count));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user