public void TestTranslate() { var offset = new CGPoint(5.6, 7.8); var result = _rect.Translate(offset); AssertUtilsIOS.AreEqualCGRect(new CGRect(_rect.X + offset.X, _rect.Y + offset.Y, _rect.Width, _rect.Height), result); }
public void TestScale() { var factor = new CGSize(500, 600); var result = _rect.Scale(factor); AssertUtilsIOS.AreEqualCGRect( new CGRect(_rect.X * factor.Width, _rect.Y * factor.Height, _rect.Width * factor.Width, _rect.Height * factor.Height), result); }
public void TestNormalize() { var rect = new CGRect(500, 600, 700, 800); var size = new CGSize(900, 1000); var result = rect.Normalize(size); AssertUtilsIOS.AreEqualCGRect( new CGRect(rect.X / size.Width, rect.Y / size.Height, rect.Width / size.Width, rect.Height / size.Height), result); }
public void TestToCGRect() { var result = _rect.ToCGRect(); AssertUtilsIOS.AreEqualCGRect(new CGRect(0.1, 0.1, 1.1, 1.1), result); }