Исправлена отрисовка объекта

This commit is contained in:
Danil Malin 2022-09-24 14:00:29 +04:00
parent 747b5c1c87
commit 96477035a8

View File

@ -123,13 +123,13 @@ namespace WarmlyLocomotive
Pen pen = new(Color.Black); Pen pen = new(Color.Black);
Brush br = new SolidBrush(Locomotive?.BodyColor ?? Color.Black); Brush br = new SolidBrush(Locomotive?.BodyColor ?? Color.Black);
//кузов //кузов
PointF[] polygon_points = new PointF[4]; PointF[] polygonPoints = new PointF[4];
polygon_points[0] = new PointF(_startPosX + 10, _startPosY); polygonPoints[0] = new PointF(_startPosX + 10, _startPosY);
polygon_points[1] = new PointF(_startPosX + 190, _startPosY); polygonPoints[1] = new PointF(_startPosX + 190, _startPosY);
polygon_points[2] = new PointF(_startPosX + 210, _startPosY + 40); polygonPoints[2] = new PointF(_startPosX + 210, _startPosY + 40);
polygon_points[3] = new PointF(_startPosX + 10, _startPosY + 40); polygonPoints[3] = new PointF(_startPosX + 10, _startPosY + 40);
g.FillPolygon(br, polygon_points); g.FillPolygon(br, polygonPoints);
g.DrawPolygon(pen, polygon_points); g.DrawPolygon(pen, polygonPoints);
g.FillRectangle(br, _startPosX + 10, _startPosY + 40, 200, 40); g.FillRectangle(br, _startPosX + 10, _startPosY + 40, 200, 40);
g.DrawRectangle(pen, _startPosX + 10, _startPosY + 40, 200, 40); g.DrawRectangle(pen, _startPosX + 10, _startPosY + 40, 200, 40);
//колеса //колеса
@ -138,6 +138,11 @@ namespace WarmlyLocomotive
g.FillEllipse(brGray, _startPosX + 70, _startPosY + 80, 30, 25); g.FillEllipse(brGray, _startPosX + 70, _startPosY + 80, 30, 25);
g.FillEllipse(brGray, _startPosX + 130, _startPosY + 80, 30, 25); g.FillEllipse(brGray, _startPosX + 130, _startPosY + 80, 30, 25);
g.FillEllipse(brGray, _startPosX + 170, _startPosY + 80, 30, 25); g.FillEllipse(brGray, _startPosX + 170, _startPosY + 80, 30, 25);
Pen dopPen = new(Color.Black, 2);
g.DrawEllipse(dopPen, _startPosX + 30, _startPosY + 80, 30, 25);
g.DrawEllipse(dopPen, _startPosX + 70, _startPosY + 80, 30, 25);
g.DrawEllipse(dopPen, _startPosX + 130, _startPosY + 80, 30, 25);
g.DrawEllipse(dopPen, _startPosX + 170, _startPosY + 80, 30, 25);
//стекла и дверь //стекла и дверь
Brush brBrown = new SolidBrush(Color.Brown); Brush brBrown = new SolidBrush(Color.Brown);
g.FillRectangle(brBrown, _startPosX + 100, _startPosY + 20, 25, 45); g.FillRectangle(brBrown, _startPosX + 100, _startPosY + 20, 25, 45);