| 10 | using test::is_equal; |
| 11 | |
| 12 | static void check_set_from_rect(ScreenBase & screen, int width, int height) |
| 13 | { |
| 14 | screen.OnSize(0, 0, width, height); |
| 15 | |
| 16 | m2::PointD b1(0.0, 0.0); |
| 17 | m2::PointD b2(300.0, 300.0); |
| 18 | screen.SetFromRect(m2::AnyRectD(m2::RectD(b1, b2))); |
| 19 | |
| 20 | b1 = screen.GtoP(b1); |
| 21 | b2 = screen.GtoP(b2); |
| 22 | |
| 23 | // check that we are in boundaries. |
| 24 | TEST(math::Between(0, width, math::iround(b1.x)), ()); |
| 25 | TEST(math::Between(0, width, math::iround(b2.x)), ()); |
| 26 | TEST(math::Between(0, height, math::iround(b1.y)), ()); |
| 27 | TEST(math::Between(0, height, math::iround(b2.y)), ()); |
| 28 | } |
| 29 | |
| 30 | UNIT_TEST(ScreenBase_P2G2P) |
| 31 | { |