!48533 修复了grid底部有概率回弹失败的问题

Merge pull request !48533 from tomkl123/20241114_grid_sync
This commit is contained in:
openharmony_ci 2024-11-14 08:30:43 +00:00 committed by Gitee
commit 49f0398538
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -1802,7 +1802,7 @@ void GridPattern::SyncLayoutBeforeSpring()
}
if (!UseIrregularLayout()) {
const float delta = info.currentOffset_ - info.prevOffset_;
if (!info.lineHeightMap_.empty() && LessOrEqual(delta, -info.lineHeightMap_.rbegin()->second)) {
if (!info.lineHeightMap_.empty() && LessOrEqual(delta, -info.lineHeightMap_[info_.startMainLineIndex_])) {
// old layout can't handle large overScroll offset. Avoid by skipping this layout.
// Spring animation plays immediately afterwards, so losing this frame's offset is fine
info.currentOffset_ = info.prevOffset_;