Chernyshev_PIbd-22_LabWork01_Base #1
@ -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>
|
||||
/// Изменение направления перемещения
|
||||
|
Loading…
Reference in New Issue
Block a user