Chernyshev_PIbd-22_LabWork01_Base #1

Closed
ujijrujijr wants to merge 2 commits from LabWork01 into main
Showing only changes of commit e8a24da5cd - Show all commits

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>
/// Изменение направления перемещения