diff --git a/AirplaneWithRadar/AirplaneWithRadar/DrawingAirplane.cs b/AirplaneWithRadar/AirplaneWithRadar/DrawingAirplane.cs index 8b6209d..2ded9de 100644 --- a/AirplaneWithRadar/AirplaneWithRadar/DrawingAirplane.cs +++ b/AirplaneWithRadar/AirplaneWithRadar/DrawingAirplane.cs @@ -59,7 +59,7 @@ namespace AirplaneWithRadar _pictureWidth = width; _pictureHeight = height; - if (x < 0 || y < 0 || width <= _airplaneWidth || height <= _airplaneHeight || x - _airplaneWidth < width || y - _airplaneHeight < height) + if (x < 0 || y < 0 || width <= _airplaneWidth || height <= _airplaneHeight || x + _airplaneWidth > width || y + _airplaneHeight > height) { _pictureHeight = null; _pictureWidth = null;