From 40490820f8e0b565a51de3cea8d66727076b374b Mon Sep 17 00:00:00 2001 From: guyuanzhang Date: Mon, 22 Mar 2021 20:46:48 +0800 Subject: [PATCH] fix uiscroll x or y drag switch in drag throw Change-Id: I496095fb7df408ab0802d16460578ed81ec44ef3 --- frameworks/components/ui_scroll_view.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frameworks/components/ui_scroll_view.cpp b/frameworks/components/ui_scroll_view.cpp index 2ed1ccf..bb05fe5 100755 --- a/frameworks/components/ui_scroll_view.cpp +++ b/frameworks/components/ui_scroll_view.cpp @@ -154,7 +154,7 @@ bool UIScrollView::DragXInner(int16_t distance) reboundSize = 0; } - if (childRect.GetWidth() <= (GetWidth() - (scrollBlankSize_ << 1))) { + if (childRect.GetWidth() <= (GetWidth() - (scrollBlankSize_ << 1)) || !xScrollable_) { return false; } @@ -193,7 +193,7 @@ bool UIScrollView::DragYInner(int16_t distance) reboundSize = 0; } - if (childRect.GetHeight() <= (GetHeight() - (scrollBlankSize_ << 1))) { + if (childRect.GetHeight() <= (GetHeight() - (scrollBlankSize_ << 1)) || !yScrollable_) { return false; } -- GitLab