@@ -674,6 +674,12 @@ TEST_F(RenderedTargetTest, GetBounds)
674674 ASSERT_EQ (std::round (bounds.right () * 100 ) / 100 , 66.72 );
675675 ASSERT_EQ (std::round (bounds.bottom () * 100 ) / 100 , -125.11 );
676676
677+ QRectF bubbleBounds = target.getBoundsForBubble ();
678+ ASSERT_EQ (std::round (bubbleBounds.left () * 100 ) / 100 , 66.13 );
679+ ASSERT_EQ (std::round (bubbleBounds.top () * 100 ) / 100 , -124.52 );
680+ ASSERT_EQ (std::round (bubbleBounds.right () * 100 ) / 100 , 66.72 );
681+ ASSERT_EQ (std::round (bubbleBounds.bottom () * 100 ) / 100 , -125.11 );
682+
677683 EXPECT_CALL (engine, stageWidth ()).WillOnce (Return (480 ));
678684 EXPECT_CALL (engine, stageHeight ()).WillOnce (Return (360 ));
679685 target.updateRotationStyle (Sprite::RotationStyle::LeftRight);
@@ -684,6 +690,12 @@ TEST_F(RenderedTargetTest, GetBounds)
684690 ASSERT_EQ (std::round (bounds.right () * 100 ) / 100 , 72.29 );
685691 ASSERT_EQ (std::round (bounds.bottom () * 100 ) / 100 , -110.89 );
686692
693+ bubbleBounds = target.getBoundsForBubble ();
694+ ASSERT_EQ (std::round (bubbleBounds.left () * 100 ) / 100 , 71.87 );
695+ ASSERT_EQ (std::round (bubbleBounds.top () * 100 ) / 100 , -110.47 );
696+ ASSERT_EQ (std::round (bubbleBounds.right () * 100 ) / 100 , 72.29 );
697+ ASSERT_EQ (std::round (bubbleBounds.bottom () * 100 ) / 100 , -110.89 );
698+
687699 EXPECT_CALL (engine, stageWidth ()).WillOnce (Return (480 ));
688700 EXPECT_CALL (engine, stageHeight ()).WillOnce (Return (360 ));
689701 target.setStageScale (20.75 );
@@ -694,5 +706,27 @@ TEST_F(RenderedTargetTest, GetBounds)
694706 ASSERT_EQ (std::round (bounds.right () * 100 ) / 100 , 72.29 );
695707 ASSERT_EQ (std::round (bounds.bottom () * 100 ) / 100 , -110.89 );
696708
709+ bubbleBounds = target.getBoundsForBubble ();
710+ ASSERT_EQ (std::round (bubbleBounds.left () * 100 ) / 100 , 71.87 );
711+ ASSERT_EQ (std::round (bubbleBounds.top () * 100 ) / 100 , -110.47 );
712+ ASSERT_EQ (std::round (bubbleBounds.right () * 100 ) / 100 , 72.29 );
713+ ASSERT_EQ (std::round (bubbleBounds.bottom () * 100 ) / 100 , -110.89 );
714+
715+ EXPECT_CALL (engine, stageWidth ()).WillOnce (Return (480 ));
716+ EXPECT_CALL (engine, stageHeight ()).WillOnce (Return (360 ));
717+ target.updateSize (9780.6 );
718+
719+ bounds = target.getBounds ();
720+ ASSERT_EQ (std::round (bounds.left () * 100 ) / 100 , -466.05 );
721+ ASSERT_EQ (std::round (bounds.top () * 100 ) / 100 , 1294.13 );
722+ ASSERT_EQ (std::round (bounds.right () * 100 ) / 100 , -405.87 );
723+ ASSERT_EQ (std::round (bounds.bottom () * 100 ) / 100 , 1233.94 );
724+
725+ bubbleBounds = target.getBoundsForBubble ();
726+ ASSERT_EQ (std::round (bubbleBounds.left () * 100 ) / 100 , -466.05 );
727+ ASSERT_EQ (std::round (bubbleBounds.top () * 100 ) / 100 , 1294.13 );
728+ ASSERT_EQ (std::round (bubbleBounds.right () * 100 ) / 100 , -405.87 );
729+ ASSERT_EQ (std::round (bubbleBounds.bottom () * 100 ) / 100 , 1286.13 );
730+
697731 context.doneCurrent ();
698732}
0 commit comments