From 710f406ab10f2c49761044abd123b4e7ec2efdbd 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 | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) 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 242f67e9a..675690547 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 @@ -380,13 +380,35 @@ bool UIList::DragYInner(int16_t distance) } distance = CalculateElasticDragLen(reboundSize, offset, distance); } - if ((childrenTail_->GetRelativeRect().GetBottom() + 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 = listHeight - scrollBlankSize_ - reboundSize - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM) - childrenTail_->GetRelativeRect().GetBottom(); } } } + // } 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