From 823b1e5890b1fd166fac98271a8a61d890743bf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B0=D0=B2=D0=B5=D0=BB=20=D0=9F=D1=83=D1=82=D0=B8?= =?UTF-8?q?=D0=BB=D0=B8=D0=BD?= Date: Mon, 3 Oct 2022 20:19:05 +0400 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AirplaneWithRadar/AirplaneWithRadar/DrawingAirplane.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/AirplaneWithRadar/AirplaneWithRadar/DrawingAirplane.cs b/AirplaneWithRadar/AirplaneWithRadar/DrawingAirplane.cs index 2749e65..8b6209d 100644 --- a/AirplaneWithRadar/AirplaneWithRadar/DrawingAirplane.cs +++ b/AirplaneWithRadar/AirplaneWithRadar/DrawingAirplane.cs @@ -54,11 +54,16 @@ namespace AirplaneWithRadar /// Высота картинки public void SetPosition(int x, int y, int width, int height) { - // TODO проверки _startPosX = x; _startPosY = y; _pictureWidth = width; _pictureHeight = height; + + if (x < 0 || y < 0 || width <= _airplaneWidth || height <= _airplaneHeight || x - _airplaneWidth < width || y - _airplaneHeight < height) + { + _pictureHeight = null; + _pictureWidth = null; + } } /// /// Изменение направления перемещения