mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-23 07:01:24 +00:00
!48293 bugfix for indicator region check
Merge pull request !48293 from LiYi/branch1112
This commit is contained in:
commit
9ecf8cc47f
@ -2725,25 +2725,34 @@ void SwiperPattern::HandleTouchEvent(const TouchEventInfo& info)
|
||||
}
|
||||
}
|
||||
|
||||
bool SwiperPattern::InsideIndicatorRegion(const TouchLocationInfo& locationInfo)
|
||||
{
|
||||
if (!HasIndicatorNode()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto indicatorNode = GetCommonIndicatorNode();
|
||||
if (!indicatorNode || !IsIndicator(indicatorNode->GetTag())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto geometryNode = indicatorNode->GetGeometryNode();
|
||||
CHECK_NULL_RETURN(geometryNode, false);
|
||||
auto hotRegion = geometryNode->GetFrameRect();
|
||||
auto touchPoint = PointF(static_cast<float>(locationInfo.GetLocalLocation().GetX()),
|
||||
static_cast<float>(locationInfo.GetLocalLocation().GetY()));
|
||||
|
||||
return hotRegion.IsInRegion(touchPoint);
|
||||
}
|
||||
|
||||
void SwiperPattern::HandleTouchDown(const TouchLocationInfo& locationInfo)
|
||||
{
|
||||
ACE_SCOPED_TRACE("Swiper HandleTouchDown");
|
||||
TAG_LOGI(AceLogTag::ACE_SWIPER, "Swiper HandleTouchDown");
|
||||
isTouchDown_ = true;
|
||||
isTouchDownOnOverlong_ = true;
|
||||
if (HasIndicatorNode()) {
|
||||
auto indicatorNode = GetCommonIndicatorNode();
|
||||
CHECK_NULL_VOID(indicatorNode);
|
||||
if (IsIndicator(indicatorNode->GetTag())) {
|
||||
auto geometryNode = indicatorNode->GetGeometryNode();
|
||||
CHECK_NULL_VOID(geometryNode);
|
||||
auto hotRegion = geometryNode->GetFrameRect();
|
||||
auto touchPoint = PointF(static_cast<float>(locationInfo.GetLocalLocation().GetX()),
|
||||
static_cast<float>(locationInfo.GetLocalLocation().GetY()));
|
||||
if (hotRegion.IsInRegion(touchPoint)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (InsideIndicatorRegion(locationInfo)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (childScrolling_) {
|
||||
|
@ -701,6 +701,7 @@ private:
|
||||
void HandleDragUpdate(const GestureEvent& info);
|
||||
void HandleDragEnd(double dragVelocity);
|
||||
|
||||
bool InsideIndicatorRegion(const TouchLocationInfo& locationInfo);
|
||||
void HandleTouchEvent(const TouchEventInfo& info);
|
||||
void HandleTouchDown(const TouchLocationInfo& locationInfo);
|
||||
void HandleTouchUp();
|
||||
|
Loading…
Reference in New Issue
Block a user