Putilin P. A. LabWork1 #1

Merged
eegov merged 3 commits from LabWork1 into master 2022-10-21 10:35:49 +04:00
Showing only changes of commit 65eddefb53 - Show all commits

View File

@ -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)
Review

Сначала выполняются проверки и только потом, если они пройдены успешно, запоминаются данные

Сначала выполняются проверки и только потом, если они пройдены успешно, запоминаются данные
{
_pictureHeight = null;
_pictureWidth = null;