@@ -663,64 +663,64 @@ TEST_F(RenderedTargetTest, GetBounds)
663
663
target.beforeRedraw ();
664
664
665
665
Rect bounds = target.getBounds ();
666
- ASSERT_EQ (std::round (bounds.left () * 100 ) / 100 , 64.96 );
667
- ASSERT_EQ (std::round (bounds.top () * 100 ) / 100 , -121.16 );
668
- ASSERT_EQ (std::round (bounds.right () * 100 ) / 100 , 67.79 );
669
- ASSERT_EQ (std::round (bounds.bottom () * 100 ) / 100 , -123.99 );
666
+ ASSERT_EQ (std::round (bounds.left () * 100 ) / 100 , 66.13 );
667
+ ASSERT_EQ (std::round (bounds.top () * 100 ) / 100 , -124.52 );
668
+ ASSERT_EQ (std::round (bounds.right () * 100 ) / 100 , 66.72 );
669
+ ASSERT_EQ (std::round (bounds.bottom () * 100 ) / 100 , -125.11 );
670
670
671
671
QRectF bubbleBounds = target.getBoundsForBubble ();
672
- ASSERT_EQ (std::round (bubbleBounds.left () * 100 ) / 100 , 64.96 );
673
- ASSERT_EQ (std::round (bubbleBounds.top () * 100 ) / 100 , -121.16 );
674
- ASSERT_EQ (std::round (bubbleBounds.right () * 100 ) / 100 , 67.79 );
675
- ASSERT_EQ (std::round (bubbleBounds.bottom () * 100 ) / 100 , -123.99 );
672
+ ASSERT_EQ (std::round (bubbleBounds.left () * 100 ) / 100 , 66.13 );
673
+ ASSERT_EQ (std::round (bubbleBounds.top () * 100 ) / 100 , -124.52 );
674
+ ASSERT_EQ (std::round (bubbleBounds.right () * 100 ) / 100 , 66.72 );
675
+ ASSERT_EQ (std::round (bubbleBounds.bottom () * 100 ) / 100 , -125.11 );
676
676
677
677
EXPECT_CALL (engine, stageWidth ()).WillOnce (Return (480 ));
678
678
EXPECT_CALL (engine, stageHeight ()).WillOnce (Return (360 ));
679
679
target.updateRotationStyle (Sprite::RotationStyle::LeftRight);
680
680
681
681
bounds = target.getBounds ();
682
- ASSERT_EQ (std::round (bounds.left () * 100 ) / 100 , 69.5 );
683
- ASSERT_EQ (std::round (bounds.top () * 100 ) / 100 , -111.26 );
684
- ASSERT_EQ (std::round (bounds.right () * 100 ) / 100 , 71.5 );
685
- ASSERT_EQ (std::round (bounds.bottom () * 100 ) / 100 , -113.26 );
682
+ ASSERT_EQ (std::round (bounds.left () * 100 ) / 100 , 71.87 );
683
+ ASSERT_EQ (std::round (bounds.top () * 100 ) / 100 , -110.47 );
684
+ ASSERT_EQ (std::round (bounds.right () * 100 ) / 100 , 72.29 );
685
+ ASSERT_EQ (std::round (bounds.bottom () * 100 ) / 100 , -110.89 );
686
686
687
687
bubbleBounds = target.getBoundsForBubble ();
688
- ASSERT_EQ (std::round (bubbleBounds.left () * 100 ) / 100 , 69.5 );
689
- ASSERT_EQ (std::round (bubbleBounds.top () * 100 ) / 100 , -111.26 );
690
- ASSERT_EQ (std::round (bubbleBounds.right () * 100 ) / 100 , 71.5 );
691
- ASSERT_EQ (std::round (bubbleBounds.bottom () * 100 ) / 100 , -113.26 );
688
+ ASSERT_EQ (std::round (bubbleBounds.left () * 100 ) / 100 , 71.87 );
689
+ ASSERT_EQ (std::round (bubbleBounds.top () * 100 ) / 100 , -110.47 );
690
+ ASSERT_EQ (std::round (bubbleBounds.right () * 100 ) / 100 , 72.29 );
691
+ ASSERT_EQ (std::round (bubbleBounds.bottom () * 100 ) / 100 , -110.89 );
692
692
693
693
EXPECT_CALL (engine, stageWidth ()).WillOnce (Return (480 ));
694
694
EXPECT_CALL (engine, stageHeight ()).WillOnce (Return (360 ));
695
695
target.setStageScale (20.75 );
696
696
697
697
bounds = target.getBounds ();
698
- ASSERT_EQ (std::round (bounds.left () * 100 ) / 100 , 69.5 );
699
- ASSERT_EQ (std::round (bounds.top () * 100 ) / 100 , -111.26 );
700
- ASSERT_EQ (std::round (bounds.right () * 100 ) / 100 , 71.5 );
701
- ASSERT_EQ (std::round (bounds.bottom () * 100 ) / 100 , -113.26 );
698
+ ASSERT_EQ (std::round (bounds.left () * 100 ) / 100 , 71.87 );
699
+ ASSERT_EQ (std::round (bounds.top () * 100 ) / 100 , -110.47 );
700
+ ASSERT_EQ (std::round (bounds.right () * 100 ) / 100 , 72.29 );
701
+ ASSERT_EQ (std::round (bounds.bottom () * 100 ) / 100 , -110.89 );
702
702
703
703
bubbleBounds = target.getBoundsForBubble ();
704
- ASSERT_EQ (std::round (bubbleBounds.left () * 100 ) / 100 , 69.5 );
705
- ASSERT_EQ (std::round (bubbleBounds.top () * 100 ) / 100 , -111.26 );
706
- ASSERT_EQ (std::round (bubbleBounds.right () * 100 ) / 100 , 71.5 );
707
- ASSERT_EQ (std::round (bubbleBounds.bottom () * 100 ) / 100 , -113.26 );
704
+ ASSERT_EQ (std::round (bubbleBounds.left () * 100 ) / 100 , 71.87 );
705
+ ASSERT_EQ (std::round (bubbleBounds.top () * 100 ) / 100 , -110.47 );
706
+ ASSERT_EQ (std::round (bubbleBounds.right () * 100 ) / 100 , 72.29 );
707
+ ASSERT_EQ (std::round (bubbleBounds.bottom () * 100 ) / 100 , -110.89 );
708
708
709
709
EXPECT_CALL (engine, stageWidth ()).WillOnce (Return (480 ));
710
710
EXPECT_CALL (engine, stageHeight ()).WillOnce (Return (360 ));
711
711
target.updateSize (9780.6 );
712
712
713
713
bounds = target.getBounds ();
714
- ASSERT_EQ (std::round (bounds.left () * 100 ) / 100 , -378.77 );
715
- ASSERT_EQ (std::round (bounds.top () * 100 ) / 100 , 1323.22 );
716
- ASSERT_EQ (std::round (bounds.right () * 100 ) / 100 , -376.77 );
717
- ASSERT_EQ (std::round (bounds.bottom () * 100 ) / 100 , 1321.22 );
714
+ ASSERT_EQ (std::round (bounds.left () * 100 ) / 100 , -466.05 );
715
+ ASSERT_EQ (std::round (bounds.top () * 100 ) / 100 , 1294.13 );
716
+ ASSERT_EQ (std::round (bounds.right () * 100 ) / 100 , -405.87 );
717
+ ASSERT_EQ (std::round (bounds.bottom () * 100 ) / 100 , 1233.94 );
718
718
719
719
bubbleBounds = target.getBoundsForBubble ();
720
- ASSERT_EQ (std::round (bubbleBounds.left () * 100 ) / 100 , -378.77 );
721
- ASSERT_EQ (std::round (bubbleBounds.top () * 100 ) / 100 , 1323.22 );
722
- ASSERT_EQ (std::round (bubbleBounds.right () * 100 ) / 100 , -376.77 );
723
- ASSERT_EQ (std::round (bubbleBounds.bottom () * 100 ) / 100 , 1321.22 );
720
+ ASSERT_EQ (std::round (bubbleBounds.left () * 100 ) / 100 , -466.05 );
721
+ ASSERT_EQ (std::round (bubbleBounds.top () * 100 ) / 100 , 1294.13 );
722
+ ASSERT_EQ (std::round (bubbleBounds.right () * 100 ) / 100 , -405.87 );
723
+ ASSERT_EQ (std::round (bubbleBounds.bottom () * 100 ) / 100 , 1286.13 );
724
724
725
725
context.doneCurrent ();
726
726
}
@@ -759,40 +759,40 @@ TEST_F(RenderedTargetTest, GetFastBounds)
759
759
target.beforeRedraw ();
760
760
761
761
Rect bounds = target.getFastBounds ();
762
- ASSERT_EQ (std::round (bounds.left () * 100 ) / 100 , 64.47 );
763
- ASSERT_EQ (std::round (bounds.top () * 100 ) / 100 , -120.57 );
764
- ASSERT_EQ (std::round (bounds.right () * 100 ) / 100 , 69.26 );
762
+ ASSERT_EQ (std::round (bounds.left () * 100 ) / 100 , 65.84 );
763
+ ASSERT_EQ (std::round (bounds.top () * 100 ) / 100 , -123.92 );
764
+ ASSERT_EQ (std::round (bounds.right () * 100 ) / 100 , 67.31 );
765
765
ASSERT_EQ (std::round (bounds.bottom () * 100 ) / 100 , -125.4 );
766
766
767
767
EXPECT_CALL (engine, stageWidth ()).WillOnce (Return (480 ));
768
768
EXPECT_CALL (engine, stageHeight ()).WillOnce (Return (360 ));
769
769
target.updateRotationStyle (Sprite::RotationStyle::LeftRight);
770
770
771
771
bounds = target.getFastBounds ();
772
- ASSERT_EQ (std::round (bounds.left () * 100 ) / 100 , 69.78 );
772
+ ASSERT_EQ (std::round (bounds.left () * 100 ) / 100 , 71.67 );
773
773
ASSERT_EQ (std::round (bounds.top () * 100 ) / 100 , -110.26 );
774
774
ASSERT_EQ (std::round (bounds.right () * 100 ) / 100 , 72.5 );
775
- ASSERT_EQ (std::round (bounds.bottom () * 100 ) / 100 , -114.34 );
775
+ ASSERT_EQ (std::round (bounds.bottom () * 100 ) / 100 , -111.51 );
776
776
777
777
EXPECT_CALL (engine, stageWidth ()).WillOnce (Return (480 ));
778
778
EXPECT_CALL (engine, stageHeight ()).WillOnce (Return (360 ));
779
779
target.setStageScale (20.75 );
780
780
781
781
bounds = target.getFastBounds ();
782
- ASSERT_EQ (std::round (bounds.left () * 100 ) / 100 , 69.78 );
782
+ ASSERT_EQ (std::round (bounds.left () * 100 ) / 100 , 71.67 );
783
783
ASSERT_EQ (std::round (bounds.top () * 100 ) / 100 , -110.26 );
784
784
ASSERT_EQ (std::round (bounds.right () * 100 ) / 100 , 72.5 );
785
- ASSERT_EQ (std::round (bounds.bottom () * 100 ) / 100 , -114.34 );
785
+ ASSERT_EQ (std::round (bounds.bottom () * 100 ) / 100 , -111.51 );
786
786
787
787
EXPECT_CALL (engine, stageWidth ()).WillOnce (Return (480 ));
788
788
EXPECT_CALL (engine, stageHeight ()).WillOnce (Return (360 ));
789
789
target.updateSize (9780.6 );
790
790
791
791
bounds = target.getFastBounds ();
792
- ASSERT_EQ (std::round (bounds.left () * 100 ) / 100 , -767 );
792
+ ASSERT_EQ (std::round (bounds.left () * 100 ) / 100 , -496.15 );
793
793
ASSERT_EQ (std::round (bounds.top () * 100 ) / 100 , 1324.22 );
794
794
ASSERT_EQ (std::round (bounds.right () * 100 ) / 100 , -375.77 );
795
- ASSERT_EQ (std::round (bounds.bottom () * 100 ) / 100 , 737.38 );
795
+ ASSERT_EQ (std::round (bounds.bottom () * 100 ) / 100 , 1143.65 );
796
796
797
797
context.doneCurrent ();
798
798
}
0 commit comments