Убраны лишние нелогичные проверки позиции и размеров объекта в классе DrawingBoat

This commit is contained in:
Nikita Potapov 2022-10-18 08:58:43 +04:00
parent 835c2ed576
commit 7628be7673

View File

@ -62,11 +62,11 @@ namespace PIbd_21_Potapov_N.S._Catamaran_Base
public void SetPosition(int x, int y, int width, int height)
{
// Проверки, что новая позиция и размеры объекта валидны
if (width < 0 || height < 0 || width > _pictureWidth || height > _pictureHeight)
if (width < 0 || height < 0)
{
return;
}
if (x < 0 || y < 0 || x >= _pictureWidth - width || y >= _pictureHeight - height)
if (x < 0 || y < 0)
{
return;
}