fix scroll nestedScrollVelocity

Signed-off-by: hongzexuan <hongzexuan@huawei.com>
Change-Id: Idf3f7aae693c63276537bed49a181e41b22b42d5
This commit is contained in:
hongzexuan 2024-11-08 17:19:29 +08:00
parent 5e22574eb8
commit c4fa19180a

View File

@ -3799,9 +3799,7 @@ float ScrollablePattern::GetNestedScrollVelocity()
if (NearZero(nestedScrollVelocity_)) {
return 0.0f;
}
auto pipeline = GetContext();
CHECK_NULL_RETURN(pipeline, 0.0f);
uint64_t currentVsync = pipeline->GetVsyncTime();
uint64_t currentVsync = static_cast<uint64_t>(GetSysTimestamp());
uint64_t diff = currentVsync - nestedScrollTimestamp_;
if (diff >= MAX_VSYNC_DIFF_TIME) {
nestedScrollVelocity_ = 0.0f;