public void IntersectTest() { var rect1 = new Geo.Rectangle(0, 0, 100, 100); var rect2 = new Geo.Rectangle(50, 50, 100, 100); Assert.IsTrue(rect1.Intersects(rect2)); Assert.IsTrue(rect2.Intersects(rect1)); rect1 = new Geo.Rectangle(0, 0, 100, 100); rect2 = new Geo.Rectangle(0, 0, 100, 100); Assert.IsTrue(rect1.Intersects(rect2)); rect1 = new Geo.Rectangle(0, 0, 100, 100); rect2 = new Geo.Rectangle(0, 0, 1, 100); Assert.IsTrue(rect1.Intersects(rect2)); }
public override void OnDragStart(Canvas canvas, float startPosX, float startPosY, float dx, float dy, bool isShiftKey, bool isCtrlKey) { var hitFigure = canvas.GetBestFigure(startPosX, startPosY, new List <Type> { typeof(Selectionbox) }, new List <Type>()); if (hitFigure != null && hitFigure.IsSelectable) { base.OnDragStart(canvas, startPosX, startPosY, dx, dy, isShiftKey, isCtrlKey); return; } _x = startPosX; _y = startPosY; //Console.WriteLine($"Drag start: {_x}, {_y}"); _selectBox = new Selectionbox(_x, _y, 10, 10); _selectBox.FillColor = Colors.Black.AdjustOpacity(0.2); _absoluteBoundingBox = _selectBox.BoundingBox.Clone(); canvas.AddAdornerFigure(_selectBox); }
public Cross(Geo.Rectangle rect) : base(rect) { }
public Rectangle(Geo.Rectangle rect) : this(rect.X, rect.Y, rect.Width, rect.Height) { }
public Selectionbox(Geo.Rectangle rect) : base(rect) { }