From a258fe0f848fb4273b55d5289a033405bcfc9b53 Mon Sep 17 00:00:00 2001 From: tellsense Date: Sun, 12 Nov 2023 23:38:39 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9B=D0=B0=D0=B1=D0=B0=205=20=D0=B3=D0=BE?= =?UTF-8?q?=D1=82=D0=BE=D0=B2=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ElectricLocomotive/DrawingElectricLocomotive.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ElectricLocomotive/ElectricLocomotive/DrawingElectricLocomotive.cs b/ElectricLocomotive/ElectricLocomotive/DrawingElectricLocomotive.cs index 64921f7..16b18ec 100644 --- a/ElectricLocomotive/ElectricLocomotive/DrawingElectricLocomotive.cs +++ b/ElectricLocomotive/ElectricLocomotive/DrawingElectricLocomotive.cs @@ -30,6 +30,7 @@ namespace ProjectElectricLocomotive.DrawingObjects Brush additionalBrush = new SolidBrush(electricLocomotive.AdditionalColor); Brush bodyColor = new SolidBrush(electricLocomotive.BodyColor); g.DrawRectangle(pen, _startPosX + 40, _startPosY + 24, 25, 11); + if (electricLocomotive.Compartment) g.FillPolygon(additionalBrush, new Point[] { new Point(_startPosX + 61, _startPosY + 25), @@ -39,11 +40,13 @@ namespace ProjectElectricLocomotive.DrawingObjects new Point(_startPosX + 61, _startPosY + 25), } ); - - g.FillRectangle(blackBrush, _startPosX + 30, _startPosY + 15, 20, 5); - g.DrawLine(pen, _startPosX + 30, _startPosY + 15, _startPosX + 50, _startPosY + 2); - g.DrawLine(pen, _startPosX + 40, _startPosY + 15, _startPosX + 60, _startPosY + 2); - base.DrawTransport(g); + if (electricLocomotive.Pantograph) + { + g.FillRectangle(blackBrush, _startPosX + 30, _startPosY + 15, 20, 5); + g.DrawLine(pen, _startPosX + 30, _startPosY + 15, _startPosX + 50, _startPosY + 2); + g.DrawLine(pen, _startPosX + 40, _startPosY + 15, _startPosX + 60, _startPosY + 2); + } + base.DrawTransport(g); } public void SetAdditionalColor(Color color) {