Лабораторная_1

This commit is contained in:
evasina2312@gmail.com 2022-09-29 14:20:33 +04:00
parent 79d20d3ed4
commit 8faf79a407

View File

@ -59,7 +59,7 @@ namespace ProjectMachine
/// <param name="height">Высота картинки</param> /// <param name="height">Высота картинки</param>
public void SetPosition(int x, int y, int width, int height) public void SetPosition(int x, int y, int width, int height)
{ {
if (x < 0 || y < 0 || x > width || y > height) if (x < 0 || y < 0 || x + _machineWidth > width || y + _machineHeight > height)
{ {
return; return;
} }
@ -124,7 +124,7 @@ namespace ProjectMachine
Pen pen = new(Color.Black); Pen pen = new(Color.Black);
Brush brBodyColor = new SolidBrush(Machine.BodyColor); Brush brBodyColor = new SolidBrush(Machine.BodyColor);
// Гусеницы // Граница гусениц
g.DrawEllipse(pen, _startPosX, _startPosY + 11, 90, 22); g.DrawEllipse(pen, _startPosX, _startPosY + 11, 90, 22);
// Кузов // Кузов