mirror of
https://github.com/openharmony/ace_ace_engine.git
synced 2026-07-21 09:55:23 -04:00
Bugfix: scrollable judgement error
Signed-off-by: bixuefeng <bixuefeng@huawei.com> Change-Id: Ia3e1fa592420015a957903f9d6c020d286096bba
This commit is contained in:
@@ -1074,24 +1074,8 @@ void RenderScroll::UpdateTouchRect()
|
||||
|
||||
bool RenderScroll::IsAxisScrollable(AxisDirection direction)
|
||||
{
|
||||
if (axis_ == Axis::VERTICAL) {
|
||||
if (direction == AxisDirection::UP && IsAtTop()) {
|
||||
return false;
|
||||
} else if (direction == AxisDirection::DOWN && IsAtBottom()) {
|
||||
return false;
|
||||
} else if (direction == AxisDirection::NONE) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (direction == AxisDirection::LEFT && IsAtTop()) {
|
||||
return false;
|
||||
} else if (direction == AxisDirection::RIGHT && IsAtBottom()) {
|
||||
return false;
|
||||
} else if (direction == AxisDirection::NONE) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return (((direction == AxisDirection::UP || direction == AxisDirection::LEFT) && !IsAtTop()) ||
|
||||
((direction == AxisDirection::DOWN || direction == AxisDirection::RIGHT) && !IsAtBottom()));
|
||||
}
|
||||
|
||||
void RenderScroll::HandleAxisEvent(const AxisEvent& event)
|
||||
|
||||
@@ -1452,24 +1452,8 @@ void RenderGridScroll::OnPredictLayout(int64_t deadline)
|
||||
|
||||
bool RenderGridScroll::IsAxisScrollable(AxisDirection direction)
|
||||
{
|
||||
if (isVertical_) {
|
||||
if (direction == AxisDirection::UP && reachHead_) {
|
||||
return false;
|
||||
} else if (direction == AxisDirection::DOWN && reachTail_) {
|
||||
return false;
|
||||
} else if (direction == AxisDirection::NONE) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (direction == AxisDirection::LEFT && reachHead_) {
|
||||
return false;
|
||||
} else if (direction == AxisDirection::RIGHT && reachTail_) {
|
||||
return false;
|
||||
} else if (direction == AxisDirection::NONE) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return (((direction == AxisDirection::UP || direction == AxisDirection::LEFT) && !reachHead_) ||
|
||||
((direction == AxisDirection::DOWN || direction == AxisDirection::RIGHT) && !reachTail_));
|
||||
}
|
||||
|
||||
void RenderGridScroll::HandleAxisEvent(const AxisEvent& event)
|
||||
|
||||
@@ -1675,24 +1675,8 @@ size_t RenderList::CalculateInsertIndex(
|
||||
|
||||
bool RenderList::IsAxisScrollable(AxisDirection direction)
|
||||
{
|
||||
if (vertical_) {
|
||||
if (direction == AxisDirection::UP && reachStart_) {
|
||||
return false;
|
||||
} else if (direction == AxisDirection::DOWN && reachEnd_) {
|
||||
return false;
|
||||
} else if (direction == AxisDirection::NONE) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (direction == AxisDirection::LEFT && reachStart_) {
|
||||
return false;
|
||||
} else if (direction == AxisDirection::RIGHT && reachEnd_) {
|
||||
return false;
|
||||
} else if (direction == AxisDirection::NONE) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return (((direction == AxisDirection::UP || direction == AxisDirection::LEFT) && !reachStart_) ||
|
||||
((direction == AxisDirection::DOWN || direction == AxisDirection::RIGHT) && !reachEnd_));
|
||||
}
|
||||
|
||||
void RenderList::HandleAxisEvent(const AxisEvent& event)
|
||||
|
||||
Reference in New Issue
Block a user