!37013 finishAnimation停止动画后布局偏移问题修复

Merge pull request !37013 from LiYi/branch0704
This commit is contained in:
openharmony_ci 2024-07-04 13:59:32 +00:00 committed by Gitee
commit 9adced65e0
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -4810,10 +4810,6 @@ void SwiperPattern::ResetAndUpdateIndexOnAnimationEnd(int32_t nextIndex)
preTargetIndex_.reset();
}
if (currentIndex_ == nextIndex) {
return;
}
if (isFinishAnimation_) {
currentDelta_ = 0.0f;
itemPosition_.clear();
@ -4825,7 +4821,7 @@ void SwiperPattern::ResetAndUpdateIndexOnAnimationEnd(int32_t nextIndex)
pipeline->FlushUITasks();
}
isFinishAnimation_ = false;
} else {
} else if (currentIndex_ != nextIndex) {
UpdateCurrentIndex(nextIndex);
if (currentFocusIndex_ < currentIndex_ || currentFocusIndex_ >= currentIndex_ + GetDisplayCount()) {
currentFocusIndex_ = currentIndex_;