Проверил Лаб1

This commit is contained in:
ujijrujijr 2023-10-19 19:12:45 +03:00
parent efcf9cea4b
commit e8a24da5cd

View File

@ -68,11 +68,8 @@ namespace Trolleybus
/// <param name="y">Координата Y</param>
public void SetPosition(int x, int y)
{
if (x > _pictureWidth || y > _pictureHeight) {
return;
}
_startPosX = x;
_startPosY = y;
_startPosX = Math.Min(Math.Max(x, 0), _pictureWidth - _trolleybusWidth);
_startPosY = Math.Min(Math.Max(y, 0), _pictureHeight - _trolleybusHeight);
}
/// <summary>
/// Изменение направления перемещения