public void Draw(IDrawDevice device) { if (clickedPos == null) { return; } var canvas = new Canvas(device); var currentPos = DualityApp.Mouse.Pos; var clickedPoint = PosToPoint(clickedPos.Value); var currentPoint = PosToPoint(currentPos); canvas.State.ColorTint = ColorRgba.Blue; foreach (var p in MapExtensions.GetPointsInLine(clickedPoint, currentPoint)) { canvas.FillRect(p.X * Grid, p.Y * Grid, Grid, Grid); } canvas.State.ColorTint = ColorRgba.Green; canvas.DrawLine(clickedPoint.X * Grid + Grid / 2, clickedPoint.Y * Grid + Grid / 2, currentPoint.X * Grid + Grid / 2, currentPoint.Y * Grid + Grid / 2); }