From efc77f06f17fd893cd71b364509bb7127e96b9d4 Mon Sep 17 00:00:00 2001 From: zhanghang Date: Wed, 25 Jun 2025 14:05:31 +0800 Subject: [PATCH] popupAvoidParentAdjust Signed-off-by: zhanghang --- .../bubble/bubble_layout_algorithm.cpp | 60 ++++++------ .../pattern/bubble/bubble_layout_algorithm.h | 1 + .../pattern/bubble/bubble_test_two_ng.cpp | 92 +++++++++---------- 3 files changed, 78 insertions(+), 75 deletions(-) diff --git a/frameworks/core/components_ng/pattern/bubble/bubble_layout_algorithm.cpp b/frameworks/core/components_ng/pattern/bubble/bubble_layout_algorithm.cpp index 5b082397c22..df6a0642733 100644 --- a/frameworks/core/components_ng/pattern/bubble/bubble_layout_algorithm.cpp +++ b/frameworks/core/components_ng/pattern/bubble/bubble_layout_algorithm.cpp @@ -1507,12 +1507,20 @@ OffsetF BubbleLayoutAlgorithm::AdjustPosition(const OffsetF& position, float wid return result; } -OffsetF BubbleLayoutAlgorithm::CoverParent(const SizeF& childSize, Placement originPlacement) +void BubbleLayoutAlgorithm::BottomAndTopPosition(OffsetF& bottomPosition, OffsetF& topPosition, const SizeF& childSize) { - OffsetF bottomPosition = OffsetF(targetOffset_.GetX() + (targetSize_.Width() - childSize.Width()) / HALF, + bottomPosition = OffsetF(targetOffset_.GetX() + (targetSize_.Width() - childSize.Width()) / HALF, targetOffset_.GetY() + targetSize_.Height() + targetSpace_.ConvertToPx() + arrowHeight_); - OffsetF topPosition = OffsetF(targetOffset_.GetX() + (targetSize_.Width() - childSize.Width()) / HALF, + topPosition = OffsetF(targetOffset_.GetX() + (targetSize_.Width() - childSize.Width()) / HALF, targetOffset_.GetY() - childSize.Height() - targetSpace_.ConvertToPx() - arrowHeight_); +} + +OffsetF BubbleLayoutAlgorithm::CoverParent(const SizeF& childSize, Placement originPlacement) +{ + // default popup position + OffsetF bottomPosition; + OffsetF topPosition; + BottomAndTopPosition(bottomPosition, topPosition, childSize); OffsetF defaultPosition = OffsetF(targetOffset_.GetX() + (targetSize_.Width() - childSize.Width()) / HALF, targetOffset_.GetY() + (targetSize_.Height() - childSize.Height()) / HALF); showArrow_ = false; @@ -1538,6 +1546,7 @@ OffsetF BubbleLayoutAlgorithm::AvoidOrCoverParent(const SizeF& childSize, const RefPtr& bubbleProp, const RefPtr child, Placement originPlacement, OffsetF& arrowOffset) { + // popup avoid parent or cover parent OffsetF position; bool canPlaceAround = canPlacement_.bottom || canPlacement_.top || canPlacement_.left || canPlacement_.right; bool canPlaceTopOrBottom = canPlacement_.bottom || canPlacement_.top; @@ -1647,10 +1656,10 @@ Rect BubbleLayoutAlgorithm::GetLeftRect() OffsetF BubbleLayoutAlgorithm::AvoidToTopOrBottomByWidth( const SizeF& childSize, OffsetF& arrowPosition, SizeF& resultSize) { - OffsetF bottomPosition = OffsetF(targetOffset_.GetX() + (targetSize_.Width() - childSize.Width()) / HALF, - targetOffset_.GetY() + targetSize_.Height() + targetSpace_.ConvertToPx() + arrowHeight_); - OffsetF topPosition = OffsetF(targetOffset_.GetX() + (targetSize_.Width() - childSize.Width()) / HALF, - targetOffset_.GetY() - childSize.Height() - targetSpace_.ConvertToPx() - arrowHeight_); + // popup avoid parent to top or bottom + OffsetF bottomPosition; + OffsetF topPosition; + BottomAndTopPosition(bottomPosition, topPosition, childSize); OffsetF resultPosition; auto topHeight = std::min( targetOffset_.GetY() - userSetTargetSpace_.ConvertToPx() - marginTop_ - BUBBLE_ARROW_HEIGHT.ConvertToPx(), @@ -1680,6 +1689,7 @@ OffsetF BubbleLayoutAlgorithm::AvoidToTopOrBottomByWidth( bool BubbleLayoutAlgorithm::AvoidToTargetPlacement( const SizeF& childSize, OffsetF& arrowPosition, OffsetF& resultPosition, SizeF& resultSize, bool canCompress) { + // popup avoid to target placement switch (placement_) { case Placement::BOTTOM_LEFT: case Placement::BOTTOM_RIGHT: @@ -1727,10 +1737,9 @@ bool BubbleLayoutAlgorithm::AvoidToTargetPlacement( bool BubbleLayoutAlgorithm::AvoidToTargetBottom( const SizeF& childSize, OffsetF& arrowPosition, OffsetF& resultPosition, SizeF& resultSize, bool canCompress) { - OffsetF bottomPosition = OffsetF(targetOffset_.GetX() + (targetSize_.Width() - childSize.Width()) / HALF, - targetOffset_.GetY() + targetSize_.Height() + targetSpace_.ConvertToPx() + arrowHeight_); - OffsetF topPosition = OffsetF(targetOffset_.GetX() + (targetSize_.Width() - childSize.Width()) / HALF, - targetOffset_.GetY() - childSize.Height() - targetSpace_.ConvertToPx() - arrowHeight_); + OffsetF bottomPosition; + OffsetF topPosition; + BottomAndTopPosition(bottomPosition, topPosition, childSize); OffsetF beforePosition = GetPositionWithPlacementNew(childSize, topPosition, bottomPosition, arrowPosition); resultPosition = beforePosition; float maxHeight = 0.0f; @@ -1767,10 +1776,9 @@ bool BubbleLayoutAlgorithm::AvoidToTargetBottom( bool BubbleLayoutAlgorithm::AvoidToTargetTop( const SizeF& childSize, OffsetF& arrowPosition, OffsetF& resultPosition, SizeF& resultSize, bool canCompress) { - OffsetF bottomPosition = OffsetF(targetOffset_.GetX() + (targetSize_.Width() - childSize.Width()) / HALF, - targetOffset_.GetY() + targetSize_.Height() + targetSpace_.ConvertToPx() + arrowHeight_); - OffsetF topPosition = OffsetF(targetOffset_.GetX() + (targetSize_.Width() - childSize.Width()) / HALF, - targetOffset_.GetY() - childSize.Height() - targetSpace_.ConvertToPx() - arrowHeight_); + OffsetF bottomPosition; + OffsetF topPosition; + BottomAndTopPosition(bottomPosition, topPosition, childSize); float maxWidth = 0.0f; float bubbleSpacing = scaledBubbleSpacing_; float arrowHalfWidth = BUBBLE_ARROW_WIDTH.ConvertToPx() / BUBBLE_ARROW_HALF; @@ -1813,10 +1821,9 @@ bool BubbleLayoutAlgorithm::AvoidToTargetTop( bool BubbleLayoutAlgorithm::AvoidToTargetTopMid( const SizeF& childSize, OffsetF& arrowPosition, OffsetF& resultPosition, SizeF& resultSize, bool canCompress) { - OffsetF bottomPosition = OffsetF(targetOffset_.GetX() + (targetSize_.Width() - childSize.Width()) / HALF, - targetOffset_.GetY() + targetSize_.Height() + targetSpace_.ConvertToPx() + arrowHeight_); - OffsetF topPosition = OffsetF(targetOffset_.GetX() + (targetSize_.Width() - childSize.Width()) / HALF, - targetOffset_.GetY() - childSize.Height() - targetSpace_.ConvertToPx() - arrowHeight_); + OffsetF bottomPosition; + OffsetF topPosition; + BottomAndTopPosition(bottomPosition, topPosition, childSize); float maxWidth = 0.0f; float bubbleSpacing = scaledBubbleSpacing_; float arrowHalfWidth = BUBBLE_ARROW_WIDTH.ConvertToPx() / BUBBLE_ARROW_HALF; @@ -1846,10 +1853,9 @@ bool BubbleLayoutAlgorithm::AvoidToTargetTopMid( bool BubbleLayoutAlgorithm::AvoidToTargetRight( const SizeF& childSize, OffsetF& arrowPosition, OffsetF& resultPosition, SizeF& resultSize, bool canCompress) { - OffsetF bottomPosition = OffsetF(targetOffset_.GetX() + (targetSize_.Width() - childSize.Width()) / HALF, - targetOffset_.GetY() + targetSize_.Height() + targetSpace_.ConvertToPx() + arrowHeight_); - OffsetF topPosition = OffsetF(targetOffset_.GetX() + (targetSize_.Width() - childSize.Width()) / HALF, - targetOffset_.GetY() - childSize.Height() - targetSpace_.ConvertToPx() - arrowHeight_); + OffsetF bottomPosition; + OffsetF topPosition; + BottomAndTopPosition(bottomPosition, topPosition, childSize); OffsetF beforePosition = GetPositionWithPlacementNew(childSize, topPosition, bottomPosition, arrowPosition); resultPosition = beforePosition; float maxHeight = 0.0f; @@ -1879,10 +1885,9 @@ bool BubbleLayoutAlgorithm::AvoidToTargetRight( bool BubbleLayoutAlgorithm::AvoidToTargetLeft( const SizeF& childSize, OffsetF& arrowPosition, OffsetF& resultPosition, SizeF& resultSize, bool canCompress) { - OffsetF bottomPosition = OffsetF(targetOffset_.GetX() + (targetSize_.Width() - childSize.Width()) / HALF, - targetOffset_.GetY() + targetSize_.Height() + targetSpace_.ConvertToPx() + arrowHeight_); - OffsetF topPosition = OffsetF(targetOffset_.GetX() + (targetSize_.Width() - childSize.Width()) / HALF, - targetOffset_.GetY() - childSize.Height() - targetSpace_.ConvertToPx() - arrowHeight_); + OffsetF bottomPosition; + OffsetF topPosition; + BottomAndTopPosition(bottomPosition, topPosition, childSize); OffsetF beforePosition = GetPositionWithPlacementNew(childSize, topPosition, bottomPosition, arrowPosition); resultPosition = beforePosition; float maxHeight = 0.0f; @@ -2425,6 +2430,7 @@ bool BubbleLayoutAlgorithm::CheckPositionLeft( bool BubbleLayoutAlgorithm::CheckPosition( const OffsetF& position, const SizeF& childSize, size_t step, size_t& i, const OffsetF& arrowPosition) { + // check popup can place at targetPlacement or not, and record max area space Rect rect; switch (placement_) { case Placement::BOTTOM_LEFT: diff --git a/frameworks/core/components_ng/pattern/bubble/bubble_layout_algorithm.h b/frameworks/core/components_ng/pattern/bubble/bubble_layout_algorithm.h index b6ed1a6e33a..427717f5f73 100644 --- a/frameworks/core/components_ng/pattern/bubble/bubble_layout_algorithm.h +++ b/frameworks/core/components_ng/pattern/bubble/bubble_layout_algorithm.h @@ -296,6 +296,7 @@ private: const SizeF& childSize, OffsetF& arrowPosition, OffsetF& resultPosition, SizeF& resultSize, bool canCompress); void RecordMaxSpace(const float maxAreaSpace, const OffsetF& position, const float maxWidth, const float maxHeight, const OffsetF& arrowPosition); + void BottomAndTopPosition(OffsetF& bottomPosition, OffsetF& topPosition, const SizeF& childSize); Rect GetBottomRect(); Rect GetTopRect(); Rect GetRightRect(); diff --git a/test/unittest/core/pattern/bubble/bubble_test_two_ng.cpp b/test/unittest/core/pattern/bubble/bubble_test_two_ng.cpp index ceeab425241..ee115cbb9d5 100644 --- a/test/unittest/core/pattern/bubble/bubble_test_two_ng.cpp +++ b/test/unittest/core/pattern/bubble/bubble_test_two_ng.cpp @@ -133,6 +133,8 @@ public: void InitSetting(BubbleLayoutAlgorithm& algorithm); void InitFuncMap(BubbleLayoutAlgorithm& algorithm); void InitCanPlacement(BubbleLayoutAlgorithm& algorithm); + void InitGetRectSetting(BubbleLayoutAlgorithm& algorithm); + void InitCheckPositionSetting(BubbleLayoutAlgorithm& algorithm); protected: static RefPtr CreateBubbleNode(const TestProperty& testProperty); @@ -164,7 +166,35 @@ void BubbleTestTwoNg::InitSetting(BubbleLayoutAlgorithm& algorithm) algorithm.marginBottom_ = MARGIN_BOTTOM; algorithm.targetSpace_ = Dimension(0.0f); algorithm.userSetTargetSpace_ = Dimension(0.0f); - return; +} + +void BubbleTestTwoNg::InitGetRectSetting(BubbleLayoutAlgorithm& algorithm) +{ + algorithm.marginStart_ = MARGIN_START; + algorithm.marginEnd_ = MARGIN_END; + algorithm.marginTop_ = MARGIN_TOP; + algorithm.marginBottom_ = MARGIN_BOTTOM; + algorithm.targetSpace_ = Dimension(0.0f); + algorithm.userSetTargetSpace_ = Dimension(0.0f); + algorithm.wrapperSize_ = SizeF(SIZE_TWO_HUNDRED, SIZE_TWO_HUNDRED); + algorithm.wrapperRect_.SetRect(0.0f, 0.0f, SIZE_TWO_HUNDRED, SIZE_TWO_HUNDRED); + algorithm.targetOffset_ = OffsetF(POSITION_FIFTY, POSITION_FIFTY); + algorithm.targetSize_ = SizeF(SIZE_ONE_HUNDRED, SIZE_ONE_HUNDRED); +} + +void BubbleTestTwoNg::InitCheckPositionSetting(BubbleLayoutAlgorithm& algorithm) +{ + algorithm.marginStart_ = MARGIN_START; + algorithm.marginEnd_ = MARGIN_END; + algorithm.marginTop_ = MARGIN_TOP; + algorithm.marginBottom_ = MARGIN_BOTTOM; + algorithm.targetSpace_ = Dimension(0.0f); + algorithm.userSetTargetSpace_ = Dimension(0.0f); + algorithm.wrapperSize_ = SizeF(SIZE_FIVE_HUNDRED, SIZE_FIVE_HUNDRED); + algorithm.wrapperRect_.SetRect(0.0f, 0.0f, SIZE_FIVE_HUNDRED, SIZE_FIVE_HUNDRED); + algorithm.targetOffset_ = OffsetF(OFFSET_TWO_HUNDRED, OFFSET_TWO_HUNDRED); + algorithm.targetSize_ = SizeF(SIZE_ONE_HUNDRED, SIZE_ONE_HUNDRED); + algorithm.isHalfFoldHover_ = false; } void BubbleTestTwoNg::InitFuncMap(BubbleLayoutAlgorithm& algorithm) @@ -181,7 +211,6 @@ void BubbleTestTwoNg::InitFuncMap(BubbleLayoutAlgorithm& algorithm) algorithm.placementFuncMap_[Placement::RIGHT] = &BubbleLayoutAlgorithm::GetPositionWithPlacementRight; algorithm.placementFuncMap_[Placement::RIGHT_TOP] = &BubbleLayoutAlgorithm::GetPositionWithPlacementRightTop; algorithm.placementFuncMap_[Placement::RIGHT_BOTTOM] = &BubbleLayoutAlgorithm::GetPositionWithPlacementRightBottom; - return; } void BubbleTestTwoNg::InitCanPlacement(BubbleLayoutAlgorithm& algorithm) @@ -190,7 +219,6 @@ void BubbleTestTwoNg::InitCanPlacement(BubbleLayoutAlgorithm& algorithm) algorithm.canPlacement_.top = true; algorithm.canPlacement_.right = true; algorithm.canPlacement_.left = true; - return; } RefPtr BubbleTestTwoNg::CreateTargetNode() @@ -768,9 +796,13 @@ HWTEST_F(BubbleTestTwoNg, AvoidToTargetTopMid001, TestSize.Level1) SizeF childSize(SIZE_EIGHTY, SIZE_THIRTY); OffsetF arrowPosition(0.0f, 0.0f); OffsetF resultPosition(0.0f, 0.0f); - SizeF size; + SizeF size(SIZE_THIRTY, SIZE_THIRTY); EXPECT_FALSE(algorithm.AvoidToTargetTopMid(childSize, arrowPosition, resultPosition, size, false)); + EXPECT_FLOAT_EQ(size.Width(), RESULT_THIRTY); + EXPECT_FLOAT_EQ(size.Height(), RESULT_THIRTY); + EXPECT_FLOAT_EQ(resultPosition.GetX(), 0.0f); + EXPECT_FLOAT_EQ(resultPosition.GetY(), 0.0f); } /** @@ -1079,12 +1111,7 @@ HWTEST_F(BubbleTestTwoNg, AvoidToTargetLeft004, TestSize.Level1) HWTEST_F(BubbleTestTwoNg, CheckPositionBottom001, TestSize.Level1) { BubbleLayoutAlgorithm algorithm; - algorithm.wrapperSize_ = SizeF(SIZE_FIVE_HUNDRED, SIZE_FIVE_HUNDRED); - BubbleTestTwoNg::InitSetting(algorithm); - algorithm.wrapperRect_.SetRect(0.0f, 0.0f, SIZE_FIVE_HUNDRED, SIZE_FIVE_HUNDRED); - algorithm.targetOffset_ = OffsetF(OFFSET_TWO_HUNDRED, OFFSET_TWO_HUNDRED); - algorithm.targetSize_ = SizeF(SIZE_ONE_HUNDRED, SIZE_ONE_HUNDRED); - algorithm.isHalfFoldHover_ = false; + BubbleTestTwoNg::InitCheckPositionSetting(algorithm); algorithm.maxAreaSpace_ = 0.0f; size_t i = 0; @@ -1119,12 +1146,7 @@ HWTEST_F(BubbleTestTwoNg, CheckPositionBottom001, TestSize.Level1) HWTEST_F(BubbleTestTwoNg, CheckPositionTop001, TestSize.Level1) { BubbleLayoutAlgorithm algorithm; - algorithm.wrapperSize_ = SizeF(SIZE_FIVE_HUNDRED, SIZE_FIVE_HUNDRED); - BubbleTestTwoNg::InitSetting(algorithm); - algorithm.wrapperRect_.SetRect(0.0f, 0.0f, SIZE_FIVE_HUNDRED, SIZE_FIVE_HUNDRED); - algorithm.targetOffset_ = OffsetF(OFFSET_TWO_HUNDRED, OFFSET_TWO_HUNDRED); - algorithm.targetSize_ = SizeF(SIZE_ONE_HUNDRED, SIZE_ONE_HUNDRED); - algorithm.isHalfFoldHover_ = false; + BubbleTestTwoNg::InitCheckPositionSetting(algorithm); algorithm.maxAreaSpace_ = 0.0f; size_t i = 0; @@ -1159,12 +1181,7 @@ HWTEST_F(BubbleTestTwoNg, CheckPositionTop001, TestSize.Level1) HWTEST_F(BubbleTestTwoNg, CheckPositionRight001, TestSize.Level1) { BubbleLayoutAlgorithm algorithm; - algorithm.wrapperSize_ = SizeF(SIZE_FIVE_HUNDRED, SIZE_FIVE_HUNDRED); - BubbleTestTwoNg::InitSetting(algorithm); - algorithm.wrapperRect_.SetRect(0.0f, 0.0f, SIZE_FIVE_HUNDRED, SIZE_FIVE_HUNDRED); - algorithm.targetOffset_ = OffsetF(OFFSET_TWO_HUNDRED, OFFSET_TWO_HUNDRED); - algorithm.targetSize_ = SizeF(SIZE_ONE_HUNDRED, SIZE_ONE_HUNDRED); - algorithm.isHalfFoldHover_ = false; + BubbleTestTwoNg::InitCheckPositionSetting(algorithm); algorithm.maxAreaSpace_ = 0.0f; size_t i = 0; @@ -1199,12 +1216,7 @@ HWTEST_F(BubbleTestTwoNg, CheckPositionRight001, TestSize.Level1) HWTEST_F(BubbleTestTwoNg, CheckPositionLeft001, TestSize.Level1) { BubbleLayoutAlgorithm algorithm; - algorithm.wrapperSize_ = SizeF(SIZE_FIVE_HUNDRED, SIZE_FIVE_HUNDRED); - BubbleTestTwoNg::InitSetting(algorithm); - algorithm.wrapperRect_.SetRect(0.0f, 0.0f, SIZE_FIVE_HUNDRED, SIZE_FIVE_HUNDRED); - algorithm.targetOffset_ = OffsetF(OFFSET_TWO_HUNDRED, OFFSET_TWO_HUNDRED); - algorithm.targetSize_ = SizeF(SIZE_ONE_HUNDRED, SIZE_ONE_HUNDRED); - algorithm.isHalfFoldHover_ = false; + BubbleTestTwoNg::InitCheckPositionSetting(algorithm); algorithm.maxAreaSpace_ = 0.0f; size_t i = 0; @@ -1239,11 +1251,7 @@ HWTEST_F(BubbleTestTwoNg, CheckPositionLeft001, TestSize.Level1) HWTEST_F(BubbleTestTwoNg, GetBottomRect001, TestSize.Level1) { BubbleLayoutAlgorithm algorithm; - algorithm.wrapperSize_ = SizeF(SIZE_TWO_HUNDRED, SIZE_TWO_HUNDRED); - BubbleTestTwoNg::InitSetting(algorithm); - algorithm.wrapperRect_.SetRect(0.0f, 0.0f, SIZE_TWO_HUNDRED, SIZE_TWO_HUNDRED); - algorithm.targetOffset_ = OffsetF(POSITION_FIFTY, POSITION_FIFTY); - algorithm.targetSize_ = SizeF(SIZE_ONE_HUNDRED, SIZE_ONE_HUNDRED); + BubbleTestTwoNg::InitGetRectSetting(algorithm); algorithm.isHalfFoldHover_ = false; Rect rect = algorithm.GetBottomRect(); @@ -1268,11 +1276,7 @@ HWTEST_F(BubbleTestTwoNg, GetBottomRect001, TestSize.Level1) HWTEST_F(BubbleTestTwoNg, GetTopRect001, TestSize.Level1) { BubbleLayoutAlgorithm algorithm; - algorithm.wrapperSize_ = SizeF(SIZE_TWO_HUNDRED, SIZE_TWO_HUNDRED); - BubbleTestTwoNg::InitSetting(algorithm); - algorithm.wrapperRect_.SetRect(0.0f, 0.0f, SIZE_TWO_HUNDRED, SIZE_TWO_HUNDRED); - algorithm.targetOffset_ = OffsetF(POSITION_FIFTY, POSITION_FIFTY); - algorithm.targetSize_ = SizeF(SIZE_ONE_HUNDRED, SIZE_ONE_HUNDRED); + BubbleTestTwoNg::InitGetRectSetting(algorithm); algorithm.isHalfFoldHover_ = false; Rect rect = algorithm.GetTopRect(); @@ -1297,11 +1301,7 @@ HWTEST_F(BubbleTestTwoNg, GetTopRect001, TestSize.Level1) HWTEST_F(BubbleTestTwoNg, GetRightRect001, TestSize.Level1) { BubbleLayoutAlgorithm algorithm; - algorithm.wrapperSize_ = SizeF(SIZE_TWO_HUNDRED, SIZE_TWO_HUNDRED); - BubbleTestTwoNg::InitSetting(algorithm); - algorithm.wrapperRect_.SetRect(0.0f, 0.0f, SIZE_TWO_HUNDRED, SIZE_TWO_HUNDRED); - algorithm.targetOffset_ = OffsetF(POSITION_FIFTY, POSITION_FIFTY); - algorithm.targetSize_ = SizeF(SIZE_ONE_HUNDRED, SIZE_ONE_HUNDRED); + BubbleTestTwoNg::InitGetRectSetting(algorithm); algorithm.isHalfFoldHover_ = false; Rect rect = algorithm.GetRightRect(); @@ -1326,11 +1326,7 @@ HWTEST_F(BubbleTestTwoNg, GetRightRect001, TestSize.Level1) HWTEST_F(BubbleTestTwoNg, GetLeftRect001, TestSize.Level1) { BubbleLayoutAlgorithm algorithm; - algorithm.wrapperSize_ = SizeF(SIZE_TWO_HUNDRED, SIZE_TWO_HUNDRED); - BubbleTestTwoNg::InitSetting(algorithm); - algorithm.wrapperRect_.SetRect(0.0f, 0.0f, SIZE_TWO_HUNDRED, SIZE_TWO_HUNDRED); - algorithm.targetOffset_ = OffsetF(POSITION_FIFTY, POSITION_FIFTY); - algorithm.targetSize_ = SizeF(SIZE_ONE_HUNDRED, SIZE_ONE_HUNDRED); + BubbleTestTwoNg::InitGetRectSetting(algorithm); algorithm.isHalfFoldHover_ = false; Rect rect = algorithm.GetLeftRect(); -- Gitee