Корректировка отрисовки

This commit is contained in:
VladaM 2024-02-15 16:38:02 +04:00
parent 8045b73f6b
commit b07d74e8e8
2 changed files with 19 additions and 19 deletions

View File

@ -17,7 +17,7 @@ public class DrawningGasolineTanker : DrawningTanker
/// <param name="signalBeacon">Признак наличия сигнального маячка</param> /// <param name="signalBeacon">Признак наличия сигнального маячка</param>
/// <param name="cistern">Признак наличия цистерны</param> /// <param name="cistern">Признак наличия цистерны</param>
public DrawningGasolineTanker(int speed, double weight, Color bodyColor, Color additionalColor, bool signalBeacon, bool cistern) : base(155, 95) public DrawningGasolineTanker(int speed, double weight, Color bodyColor, Color additionalColor, bool signalBeacon, bool cistern) : base(130, 90)
{ {
EntityTanker = new EntityGasolineTanker(speed, weight, bodyColor, additionalColor, signalBeacon, cistern); EntityTanker = new EntityGasolineTanker(speed, weight, bodyColor, additionalColor, signalBeacon, cistern);
} }
@ -32,22 +32,22 @@ public class DrawningGasolineTanker : DrawningTanker
Pen pen = new(Color.Black); Pen pen = new(Color.Black);
Brush additionalBrush = new SolidBrush(gasolineTanker.AdditionalColor); Brush additionalBrush = new SolidBrush(gasolineTanker.AdditionalColor);
base.DrawTransport(g);
// Цистерна // Цистерна
if (gasolineTanker.Cistern) if (gasolineTanker.Cistern)
{ {
g.FillRectangle(additionalBrush, _startPosX.Value + 25, _startPosY.Value + 15, 90, 40); g.FillRectangle(additionalBrush, _startPosX.Value, _startPosY.Value + 10, 90, 40);
g.FillRectangle(additionalBrush, _startPosX.Value + 80, _startPosY.Value + 10, 10, 5); g.FillRectangle(additionalBrush, _startPosX.Value + 55, _startPosY.Value + 5, 10, 5);
} }
// Сигнальный маячок // Сигнальный маячок
if (gasolineTanker.SignalBeacon) if (gasolineTanker.SignalBeacon)
{ {
g.FillRectangle(additionalBrush, _startPosX.Value + 145, _startPosY.Value + 5, 10, 10); g.FillRectangle(additionalBrush, _startPosX.Value + 120, _startPosY.Value, 10, 10);
} }
_startPosY += 10;
base.DrawTransport(g);
_startPosY -= 10;
} }
} }

View File

@ -39,12 +39,12 @@ public class DrawningTanker
/// <summary> /// <summary>
/// Ширина прорисовки грузовика /// Ширина прорисовки грузовика
/// </summary> /// </summary>
private readonly int _drawningTankerWidth = 155; private readonly int _drawningTankerWidth = 130;
/// <summary> /// <summary>
/// Высота прорисовки грузовика /// Высота прорисовки грузовика
/// </summary> /// </summary>
private readonly int _drawningTankerHeight = 95; private readonly int _drawningTankerHeight = 80;
/// <summary> /// <summary>
/// Координата X объекта /// Координата X объекта
@ -209,26 +209,26 @@ public class DrawningTanker
// Границы бензовоза // Границы бензовоза
g.DrawRectangle(pen, _startPosX.Value + 120, _startPosY.Value + 20, 25, 25); g.DrawRectangle(pen, _startPosX.Value + 95, _startPosY.Value + 5, 25, 25);
g.DrawRectangle(pen, _startPosX.Value + 115, _startPosY.Value + 15, 40, 40); g.DrawRectangle(pen, _startPosX.Value + 90, _startPosY.Value, 40, 40);
g.DrawRectangle(pen, _startPosX.Value + 25, _startPosY.Value + 55, 130, 15); g.DrawRectangle(pen, _startPosX.Value, _startPosY.Value + 40, 130, 15);
// Колеса // Колеса
Brush brBlack = new SolidBrush(Color.Black); Brush brBlack = new SolidBrush(Color.Black);
g.FillEllipse(brBlack, _startPosX.Value + 130, _startPosY.Value + 70, 25, 25); g.FillEllipse(brBlack, _startPosX.Value + 105, _startPosY.Value + 55, 25, 25);
g.FillEllipse(brBlack, _startPosX.Value + 30, _startPosY.Value + 70, 25, 25); g.FillEllipse(brBlack, _startPosX.Value + 5, _startPosY.Value + 55, 25, 25);
g.FillEllipse(brBlack, _startPosX.Value + 55, _startPosY.Value + 70, 25, 25); g.FillEllipse(brBlack, _startPosX.Value + 30, _startPosY.Value + 55, 25, 25);
// Кузов // Кузов
Brush br = new SolidBrush(EntityTanker.BodyColor); Brush br = new SolidBrush(EntityTanker.BodyColor);
g.FillRectangle(br, _startPosX.Value + 116, _startPosY.Value + 16, 39, 39); g.FillRectangle(br, _startPosX.Value + 91, _startPosY.Value + 1, 39, 39);
g.FillRectangle(br, _startPosX.Value + 26, _startPosY.Value + 56, 129, 14); g.FillRectangle(br, _startPosX.Value + 1, _startPosY.Value + 41, 129, 14);
// Стекло // Стекло
Brush brBlue = new SolidBrush(Color.LightBlue); Brush brBlue = new SolidBrush(Color.LightBlue);
g.FillRectangle(brBlue, _startPosX.Value + 120, _startPosY.Value + 20, 25, 25); g.FillRectangle(brBlue, _startPosX.Value + 95, _startPosY.Value + 5, 25, 25);
} }
} }