public void NotContainsPoint(IDrawingTarget target, IDrawingBackend backend)
        {
            var c1 = backend.Ellipse(30, 10, 20, 20);
            var c2 = backend.Rectangle(30, 10, 1, 1);

            target.Fill(color: new Color(0.7, 0.7, 1, 0.7));
            target.Geometry(c1);
            target.Geometry(c2);

            if (c1.Contains(30, 10))
                throw new Exception("circle is not expected to contain point at 30, 10");
        }
        public void ContainsPoint(IDrawingTarget target, IDrawingBackend backend)
        {
            var c1 = backend.Ellipse(30, 10, 20, 20);
            var c2 = backend.Rectangle(40, 20, 1, 1);

            target.Fill(color: new Color(0.7, 0.7, 1, 0.7));
            target.Geometry(c1);
            target.Geometry(c2);

            if (!c1.Contains(40, 20))
            {
                throw new Exception("circle is expected to contain point at 40, 20");
            }
        }
示例#3
0
		public static IGeometry Rectangle(this IDrawingBackend backend, Rectangle rectangle)
		{
			return backend.Rectangle(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
		}