public void Render() { if (dragging) { var min = new Vector2(Math.Min(startDragPosition.X, currentDragPosition.X), Math.Min(startDragPosition.Y, currentDragPosition.Y)); var max = new Vector2(Math.Max(startDragPosition.X, currentDragPosition.X), Math.Max(startDragPosition.Y, currentDragPosition.Y)); var size = max - min; uiManager.DrawBox(min.X, min.Y, size.X, size.Y, new Vector4(0.2f, 0.66f, 1, 0.4f)); } }