Проверил Лаб1
This commit is contained in:
parent
efcf9cea4b
commit
e8a24da5cd
@ -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