提交 467a1ec6 编写于 作者: G guyuanzhang

Sig:graphic

Feature or Bugfix:Feature
Binary Source:No
上级 7a31a93b
...@@ -282,18 +282,18 @@ bool UIList::DragXInner(int16_t distance) ...@@ -282,18 +282,18 @@ bool UIList::DragXInner(int16_t distance)
return MoveOffset(distance); return MoveOffset(distance);
} }
if (distance > 0) { if (distance > 0) {
if (childrenHead_ && (childrenHead_->GetX() + distance > if (childrenHead_ && ((childrenHead_->GetX() + distance) >
scrollBlankSize_ + reboundSize + childrenHead_->GetStyle(STYLE_MARGIN_LEFT))) { (scrollBlankSize_ + reboundSize + childrenHead_->GetStyle(STYLE_MARGIN_LEFT)))) {
distance = distance =
scrollBlankSize_ + reboundSize + childrenHead_->GetStyle(STYLE_MARGIN_LEFT) - childrenHead_->GetX(); scrollBlankSize_ + reboundSize + childrenHead_->GetStyle(STYLE_MARGIN_LEFT) - childrenHead_->GetX();
} }
} else { } else {
if (childrenTail_) { if (childrenTail_) {
if (childrenTail_->GetRelativeRect().GetRight() <= if (childrenTail_->GetRelativeRect().GetRight() <=
listWidth - scrollBlankSize_ - reboundSize - childrenTail_->GetStyle(STYLE_MARGIN_RIGHT)) { (listWidth - scrollBlankSize_ - reboundSize - childrenTail_->GetStyle(STYLE_MARGIN_RIGHT))) {
distance = 0; distance = 0;
} else if (listWidth - (childrenTail_->GetX() + childrenTail_->GetRelativeRect().GetWidth() + distance) > } else if ((listWidth - childrenTail_->GetX() - childrenTail_->GetRelativeRect().GetWidth() - distance) >
scrollBlankSize_ + reboundSize + childrenTail_->GetStyle(STYLE_MARGIN_RIGHT)) { (scrollBlankSize_ + reboundSize + childrenTail_->GetStyle(STYLE_MARGIN_RIGHT))) {
distance = listWidth - scrollBlankSize_ - reboundSize - childrenTail_->GetX() - distance = listWidth - scrollBlankSize_ - reboundSize - childrenTail_->GetX() -
childrenTail_->GetRelativeRect().GetWidth() - childrenTail_->GetStyle(STYLE_MARGIN_RIGHT); childrenTail_->GetRelativeRect().GetWidth() - childrenTail_->GetStyle(STYLE_MARGIN_RIGHT);
} }
...@@ -324,18 +324,19 @@ bool UIList::DragYInner(int16_t distance) ...@@ -324,18 +324,19 @@ bool UIList::DragYInner(int16_t distance)
return MoveOffset(distance); return MoveOffset(distance);
} }
if (distance > 0) { if (distance > 0) {
if (childrenHead_ && (childrenHead_->GetY() + distance > if (childrenHead_ &&
scrollBlankSize_ + reboundSize + childrenHead_->GetStyle(STYLE_MARGIN_TOP))) { ((childrenHead_->GetY() + distance) >
(scrollBlankSize_ + reboundSize + childrenHead_->GetStyle(STYLE_MARGIN_TOP)))) {
distance = distance =
scrollBlankSize_ + reboundSize + childrenHead_->GetStyle(STYLE_MARGIN_TOP) - childrenHead_->GetY(); scrollBlankSize_ + reboundSize + childrenHead_->GetStyle(STYLE_MARGIN_TOP) - childrenHead_->GetY();
} }
} else { } else {
if (childrenTail_) { if (childrenTail_) {
if (childrenTail_->GetRelativeRect().GetBottom() <= if (childrenTail_->GetRelativeRect().GetBottom() <=
listHeigh - scrollBlankSize_ - reboundSize - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM)) { (listHeigh - scrollBlankSize_ - reboundSize - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM))) {
distance = 0; distance = 0;
} else if (listHeigh - (childrenTail_->GetY() + childrenTail_->GetRelativeRect().GetHeight() + distance) > } else if ((listHeigh - childrenTail_->GetY() - childrenTail_->GetRelativeRect().GetHeight() - distance) >
scrollBlankSize_ + reboundSize + childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM)) { (scrollBlankSize_ + reboundSize + childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM))) {
distance = listHeigh - scrollBlankSize_ - reboundSize - childrenTail_->GetY() - distance = listHeigh - scrollBlankSize_ - reboundSize - childrenTail_->GetY() -
childrenTail_->GetRelativeRect().GetHeight() - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM); childrenTail_->GetRelativeRect().GetHeight() - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM);
} }
...@@ -504,10 +505,10 @@ void UIList::PushBack(UIView* view) ...@@ -504,10 +505,10 @@ void UIList::PushBack(UIView* view)
if (direction_ == VERTICAL) { if (direction_ == VERTICAL) {
view->SetPosition(view->GetStyle(STYLE_MARGIN_LEFT), view->SetPosition(view->GetStyle(STYLE_MARGIN_LEFT),
childrenTail_->GetY() + childrenTail_->GetRelativeRect().GetHeight() + childrenTail_->GetY() + childrenTail_->GetRelativeRect().GetHeight() +
childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM) + view->GetStyle(STYLE_MARGIN_TOP)); childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM) + view->GetStyle(STYLE_MARGIN_TOP));
} else { } else {
view->SetPosition(childrenTail_->GetX() + childrenTail_->GetRelativeRect().GetWidth() + view->SetPosition(childrenTail_->GetX() + childrenTail_->GetRelativeRect().GetWidth() +
childrenTail_->GetStyle(STYLE_MARGIN_RIGHT) + view->GetStyle(STYLE_MARGIN_LEFT), childrenTail_->GetStyle(STYLE_MARGIN_RIGHT) + view->GetStyle(STYLE_MARGIN_LEFT),
view->GetStyle(STYLE_MARGIN_TOP)); view->GetStyle(STYLE_MARGIN_TOP));
} }
bottomIndex_ = GetIndexInc(bottomIndex_); bottomIndex_ = GetIndexInc(bottomIndex_);
...@@ -528,10 +529,10 @@ void UIList::PushFront(UIView* view) ...@@ -528,10 +529,10 @@ void UIList::PushFront(UIView* view)
if (direction_ == VERTICAL) { if (direction_ == VERTICAL) {
view->SetPosition(view->GetStyle(STYLE_MARGIN_LEFT), view->SetPosition(view->GetStyle(STYLE_MARGIN_LEFT),
GetChildrenHead()->GetY() - GetChildrenHead()->GetStyle(STYLE_MARGIN_TOP) - GetChildrenHead()->GetY() - GetChildrenHead()->GetStyle(STYLE_MARGIN_TOP) -
view->GetRelativeRect().GetHeight() - view->GetStyle(STYLE_MARGIN_BOTTOM)); view->GetRelativeRect().GetHeight() - view->GetStyle(STYLE_MARGIN_BOTTOM));
} else { } else {
view->SetPosition(GetChildrenHead()->GetX() - GetChildrenHead()->GetStyle(STYLE_MARGIN_LEFT) - view->SetPosition(GetChildrenHead()->GetX() - GetChildrenHead()->GetStyle(STYLE_MARGIN_LEFT) -
view->GetRelativeRect().GetWidth() - view->GetStyle(STYLE_MARGIN_RIGHT), view->GetRelativeRect().GetWidth() - view->GetStyle(STYLE_MARGIN_RIGHT),
view->GetStyle(STYLE_MARGIN_TOP)); view->GetStyle(STYLE_MARGIN_TOP));
} }
topIndex_ = GetIndexDec(topIndex_); topIndex_ = GetIndexDec(topIndex_);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册