From 2198f1faf2ebcf85545395ee534f2ee86f2edd33 Mon Sep 17 00:00:00 2001 From: Caisking <3449750381@qq.com> Date: Thu, 26 Sep 2024 20:15:45 +0800 Subject: [PATCH] =?utf8?q?scrollview=E9=87=8C=E9=9D=A2=E6=B7=BB=E5=8A=A0li?= =?utf8?q?st=EF=BC=8C=E5=A6=82=E6=9E=9Clist=20item=E8=BE=83=E5=B0=91?= =?utf8?q?=EF=BC=8C=E6=BB=91=E5=8A=A8=E4=BC=9A=E6=9C=89=E5=A4=A7=E7=89=87?= =?utf8?q?=E7=A9=BA=E7=99=BD=E5=87=BA=E7=8E=B0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../ui/frameworks/components/ui_list.cpp | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_list.cpp b/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_list.cpp index 86db75298..324b922c7 100755 --- a/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_list.cpp +++ b/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_list.cpp @@ -383,6 +383,9 @@ bool UIList::DragYInner(int16_t distance) if (childrenTail_->GetRelativeRect().GetBottom() < (listHeight - scrollBlankSize_ - reboundSize - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM))) { distance = 0; + } else if ((childrenTail_->GetRelativeRect().GetBottom() + distance) < + (listHeight - scrollBlankSize_ - reboundSize - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM))) { + distance = 0; } else if ((childrenTail_->GetRelativeRect().GetBottom() + distance) < (listHeight - scrollBlankSize_ - reboundSize - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM))) { distance = listHeight - scrollBlankSize_ - reboundSize - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM) @@ -390,6 +393,25 @@ bool UIList::DragYInner(int16_t distance) } } } + // } else { + // if (childrenTail_ != nullptr) { + // if (isElastic_ && (reboundSize > 0) && + // (childrenTail_->GetRelativeRect().GetBottom() < + // (listHeight - scrollBlankSize_ - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM)))) { + // int16_t offset = (listHeight - scrollBlankSize_ - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM)) + // - (childrenTail_->GetRelativeRect().GetBottom()); + // if (offset > reboundSize) { + // offset = reboundSize; + // } + // distance = CalculateElasticDragLen(reboundSize, offset, distance); + // } + // if ((childrenTail_->GetRelativeRect().GetBottom() + distance) < + // (listHeight - scrollBlankSize_ - reboundSize - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM))) { + // distance = listHeight - scrollBlankSize_ - reboundSize - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM) + // - childrenTail_->GetRelativeRect().GetBottom(); + // } + // } + // } return MoveOffset(0, distance); } -- 2.17.1