Добавил проверки
This commit is contained in:
parent
7432af9e0b
commit
823b1e5890
@ -54,11 +54,16 @@ namespace AirplaneWithRadar
|
|||||||
/// <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)
|
||||||
{
|
{
|
||||||
// TODO проверки
|
|
||||||
_startPosX = x;
|
_startPosX = x;
|
||||||
_startPosY = y;
|
_startPosY = y;
|
||||||
_pictureWidth = width;
|
_pictureWidth = width;
|
||||||
_pictureHeight = height;
|
_pictureHeight = height;
|
||||||
|
|
||||||
|
if (x < 0 || y < 0 || width <= _airplaneWidth || height <= _airplaneHeight || x - _airplaneWidth < width || y - _airplaneHeight < height)
|
||||||
|
{
|
||||||
|
_pictureHeight = null;
|
||||||
|
_pictureWidth = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Изменение направления перемещения
|
/// Изменение направления перемещения
|
||||||
|
Loading…
Reference in New Issue
Block a user