Исправил баг с отрисовкой трактора

This commit is contained in:
Владислав Захаров 2022-10-24 18:32:38 +04:00
parent 4b3b345b66
commit 23d6e5a687
2 changed files with 13 additions and 0 deletions

View File

@ -28,6 +28,10 @@ namespace Traktor
{
return;
}
if (!DrawCheck())
{
return;
}
Pen pen_Black_1pxl = new Pen(Color.Black, 1);
Pen pen_Black_2pxl = new Pen(Color.Black, 2);
Brush brBlack = new SolidBrush(Color.Black);

View File

@ -93,6 +93,15 @@ namespace Traktor
}
}
public bool DrawCheck()
{
if (startPosX < 0 || startPosY < 0 || !pictureHeight.HasValue || !pictureWidth.HasValue)
{
return false;
}
return true;
}
//Отрисовка сущности
public virtual void DrawEntity(Graphics g)
{