!48159 修复scroll设置限位滚动,拋滑滚动条会导致scroll过界的问题

Merge pull request !48159 from honzx/1110snap
This commit is contained in:
openharmony_ci 2024-11-12 07:33:33 +00:00 committed by Gitee
commit 946f64b23b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 5 additions and 1 deletions

View File

@ -193,6 +193,10 @@ public:
{
return isPressed_;
}
bool IsDriving() const
{
return isDriving_;
}
void SetHover(bool hover)
{
isHover_ = hover;

View File

@ -166,7 +166,7 @@ bool ScrollPattern::ScrollSnapTrigger()
{
auto scrollBar = GetScrollBar();
auto scrollBarProxy = GetScrollBarProxy();
if (scrollBar && scrollBar->IsPressed()) {
if (scrollBar && scrollBar->IsDriving()) {
return false;
}
if (scrollBarProxy && scrollBarProxy->IsScrollSnapTrigger()) {